Re: NSTimestamp bug in timestampByAddingGregorianUnits
Re: NSTimestamp bug in timestampByAddingGregorianUnits
- Subject: Re: NSTimestamp bug in timestampByAddingGregorianUnits
- From: Chuck Hill <email@hidden>
- Date: Wed, 7 Oct 2009 13:25:09 -0700
On Oct 7, 2009, at 1:13 PM, Ramsey Gurley wrote:
Hi all,
Executing the following code with a default time zone of US Eastern
time
NSTimestamp ts1 = new
NSTimestamp(2009,11,1,0,0,0,NSTimeZone.defaultTimeZone());
Try
NSTimestamp ts1 = new
NSTimestamp(2009,11,1,12,0,0,NSTimeZone.defaultTimeZone());
NSTimestamp ts2 = ts1.timestampByAddingGregorianUnits( 0, 0, 1, 0,
0, 0 );
NSTimestamp ts3 = new
NSTimestamp(2009,11,2,0,0,0,NSTimeZone.defaultTimeZone());
System.out.println(NSTimeZone.defaultTimeZone().getID());
System.out.println(ts1 + "\n" + ts2 + "\n" + ts3);
produces the following result :-/
America/New_York
2009-11-01 04:00:00 Etc/GMT
2009-11-02 04:00:00 Etc/GMT
2009-11-02 05:00:00 Etc/GMT
Is this a known bug?
I suspect so. When does DST go off this year? Adding 1 day adds
exactly 24 hours, NOT one calendar day like we think about it.
Chuck
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden