Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TimeZone Date convertion

 
Joao Cunha
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks!

I want to convert a Date from an specific TimeZone to GMT-00:00 timezone
I already tried to set a Calendar with the date and set the Time Zone but it didn't work...

Any idea?
Thanks!
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did it not work? How about giving some code that shows ...
 
Joao Cunha
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Initially I have a time on an specif TimeZone:

> Calendar c = Calendar.getInstance();
> c.setTime(date);
> System.out.println(c.getTime());

I want to have this time on GMT-00:00 time zone.
I tried this, but it didn't work:

>c.setTimeZone(TimeZone.getTimeZone("GMT-00:00"));
>System.out.println(c.getTime());
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic