Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Disable daylight saving time

807603Feb 13 2007 — edited Dec 11 2007
Hi all,

I know this subject has been posted before, but i haven't found any suitable response. I need to disable daylight saving time, but i haven't been lucky yet. I've tried several things:
// Option A
Calendar calendar= new GregorianCalendar(TimeZone.getTimeZone("GMT+01:00"));

// Option B
Calendar calendar= new GregorianCalendar(TimeZone.getTimeZone(Some String Suitable));

// Option C
Calendar calendar= new GregorianCalendar(new SimpleTimeZone(int, Some String Suitable));

// Option D
SimpleTimeZone stz;
stz.setDSTSavings(0); // I get an error
And many other solutions, but it keeps applying daylight saving time and changing from 25/03/2007 01:00 to 25/03/2007 03:00. Any workarounds that doesn't involve to build my own Calendar? Also i can't disable it in the Operating System because it would affect other applications.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 8 2008
Added on Feb 13 2007
31 comments
2,953 views