• 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: NSDateFormatter bug in timeZone
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDateFormatter bug in timeZone


  • Subject: Re: NSDateFormatter bug in timeZone
  • From: Alastair Houghton <email@hidden>
  • Date: Mon, 27 Apr 2009 16:05:40 +0100

On 27 Apr 2009, at 14:54, jon wrote:

I was not using the term Data Source properly most likely, this is what i was doing..

	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	[defaults setObject:theDate forKey:@"the date"];

in a different Class object at a later time,  i retrieve it like this.

	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
	NSDate *theDate = [defaults objectForKey:@"the date"];

that is what i meant by storing the data...

Ah, OK. You've stored it in the defaults database, which will result in it being serialised in property list format. Arguably it shouldn't lose information, but I guess it does in this particular case; that's probably a bug, in and of itself.


Does this date need to be in the defaults database? i.e. is it a preference or does it need to persist in some way? If not, stick the NSDate object into a dictionary (or just a variable) instead and use it from there. If it does, you might be able to work around the problem by manually encoding the date (e.g. using NSCoder or NSKeyedArchiver), then storing the resulting NSData in the defaults database instead.

If I had time, I'd try it myself and see, but I'm really busy today...

(shouldn't PDT mean just one thing? shouldn't it be that simple? I'll try your suggestion, thanks, i'll try it with zzz, and with zzzzzzz)

:-) I'm not sure. I expect other places (besides the west coast of the United States) have PDT as well. EST is just the example I know OTOH (and interestingly it's the one quoted in the man page for strptime() as well).


(I'm not sure how to properly reply to the list yet, should i reply to both You and the list? as i'm doing here)

The rule varies from list to list, but generally on cocoa-dev people reply direct *and* to the list. It's usually considered bad form to just reply direct, because those of us who contribute here do so for the benefit of the community as a whole, not just for the individuals whose questions we try to answer.


Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSDateFormatter bug in timeZone (From: Jon <email@hidden>)
 >Re: NSDateFormatter bug in timeZone (From: Alastair Houghton <email@hidden>)
 >Re: NSDateFormatter bug in timeZone (From: jon <email@hidden>)

  • Prev by Date: Re: FSPathCopyObjectSync and symbolic links?
  • Next by Date: NSXMLParser attributeDict enumeration
  • Previous by thread: Re: NSDateFormatter bug in timeZone
  • Next by thread: Re: NSDateFormatter bug in timeZone
  • Index(es):
    • Date
    • Thread