Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DayLight Savings time TO CST conversion

 
Avanish Raut
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am converting daylight savings time to Central Standard time. I tried using TimeZone and SimpleTimeZone but when I get the date in java.util.Date format it automatically reduces 1 hour if the date passed is switchOver date i.e. First Sunday of April at 0200 Hrs.
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a bit hacky but you could simply query the timezone using the isDalightTime( Date date ) to see if it's adding an hour and then adjust accrdingly.
Sean
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic