File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes DayLight Savings time TO CST conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "DayLight Savings time TO CST conversion" Watch "DayLight Savings time TO CST conversion" New topic

DayLight Savings time TO CST conversion

Avanish Raut

Joined: Feb 20, 2001
Posts: 4
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
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
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.
It is sorta covered in the JavaRanch Style Guide.
subject: DayLight Savings time TO CST conversion
Similar Threads
Converting a date object from GMT to EST
HELP: Daylight Savings in Java
Timezone - PST and PDT
How to get java Date with Daylight savings
Date/Time conversion to GMT with DayLightSavings