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!

Hi,

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 ,
now.DAY_OF_MONTH ,
now.DAY_OF_WEEK ,
now.MILLISECOND );

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.
Fabio
Offline  
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
Default

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.
__________________
Thanks,
Mark Rejhon
Author of XMPP extension XEP-0301:
www.xmpp.org/extensions/xep-0301.html - specification
www.realjabber.org - open source
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.