• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTimestamp bug in timestampByAddingGregorianUnits
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTimestamp bug in timestampByAddingGregorianUnits


  • Subject: Re: NSTimestamp bug in timestampByAddingGregorianUnits
  • From: David LeBer <email@hidden>
  • Date: Wed, 7 Oct 2009 16:27:24 -0400


On 2009-10-07, 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?

It looks like if you create a timestamp on Nov 1 it is given EDT (EST + DST), created on Nov 2 it is given EST.


Given that DST ends on Nov 1 I'm not sure if this should be considered a bug.

;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: 	http://codeferous.com
blog: 	http://davidleber.net
profile:	http://www.linkedin.com/in/davidleber
twitter:	http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




_______________________________________________ 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
References: 
 >NSTimestamp bug in timestampByAddingGregorianUnits (From: Ramsey Gurley <email@hidden>)

  • Prev by Date: Re: NSTimestamp bug in timestampByAddingGregorianUnits
  • Next by Date: Re: NSTimestamp bug in timestampByAddingGregorianUnits
  • Previous by thread: Re: NSTimestamp bug in timestampByAddingGregorianUnits
  • Next by thread: Re: NSTimestamp bug in timestampByAddingGregorianUnits
  • Index(es):
    • Date
    • Thread