Right, but according to the docs at

http://developer.apple.com/legacy/mac/library/documentation/InternetWeb/Reference/WO542Reference/com/webobjects/foundation/NSTimestamp.html#timestampByAddingGregorianUnits(int,%20int,%20int,%20int,%20int,%20int)

"This method preserves "clock time" across changes in Daylight Savings Time zones and leap years. For example, adding one month to an NSTimestamp with a time of 12 noon correctly maintains time at 12 noon."

So the time of 12:00:00 AM should have been preserved by timestampByAddingGregorianUnits

Ramsey

On Oct 7, 2009, at 4:21 PM, David Avendasora wrote:

Isn't this the daylight-savings-time switch over? Currently we are 4 hours behind GMT, once DST is off, then we will be 5 hours behind GMT.

Dave

On Oct 7, 2009, at 4: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()); 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?

Ramsey


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com

This email sent to [email protected]


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to