Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Timezones

 
Adam Teg
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if my question qualifies as intermediate but here goes -

I want to get a time zone that will return CET or CEST. When I do the code below today I get CET but it should have given me CEST. What is up?

TimeZone.getTimeZone("Europe/Paris")

I want a time zone that knows if the time is CET or CEST

Thanks
 
Paul Clapham
Sheriff
Posts: 21945
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In what way do you "get" CET from that code?
 
Adam Teg
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is actully working. My unit test had a winter date in it. Either way I get a calander instance; set the gmt timezone since that is timezone I am getting; do an offset with "Europe/Paris".

Thanks for your response
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!