BlackBerry Forums Support Community               

Closed Thread
LinkBack Thread Tools
Old 06-20-2005, 02:19 PM   #1 (permalink)
Knows Where the Search Button Is
Join Date: Sep 2004
Posts: 24
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Help DayLight Saving

Please Login to Remove!


I write java application, wich uses this code:

TimeZone zn = null;
Calendar now = null;
zn = TimeZone.getDefault();
now.setTime(new Date());
zn = TimeZone.getDefault();

offset = zn.getOffset(1 ,
now.YEAR ,
now.MONTH ,

offset is 3600000
but, cause daylight, must be 7200000.

I use JDE 4.0 and default simulator.

Any know issue in daylight?

Thanks for any suggestion.
Old 06-26-2005, 09:03 PM   #2 (permalink)
Retired BBF Moderator
Mark Rejhon's Avatar
Join Date: Aug 2004
Location: Ottawa, Ontario, Canada
Model: Bold
Carrier: Rogers
Posts: 4,870
Post Thanks: 1
Thanked 0 Times in 0 Posts

BlackBerry automatically updates itself for daylight savings.

I think there's a daylight savings flag you can check and then compensate for that. Try looking for that. My memory is foggy at the moment, but it may be "now.ISDST" which is 1 when in daylight savings and 0 when not. There is a daylight savings flag somewhere, I'm trying to remember under which name this is...

It may be that offset was programmed not to change, because timezone is measured from "EST" rather than "EDT" (when doing this for my timezone), so in this case you would need to check the daylight savings flag and compensate for daylight savings separately.
Mark Rejhon
Author of XMPP extension XEP-0301: - specification - open source

Copyright 2004-2016
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.