Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing date strings with NSDate



On Dec 14, 2004, at 8.52, Mark Meyer wrote:
...but I can't seem to find anything in the API that handles ISO 8601 dates.

Oh, but correct ISO 8610 date formats can look so different. There are a plethora of valid variants.


The best I can get from this: 2004-12-13T09:54:32-05:00 is this: 2004-12-13 05:00:32 +0000 which is clearly wrong.

Nope, it's not. Depends on who you're talking to. The standard (apparently) makes quite clear that, for example, using the letter 'T' to separate date and time information is optional, depending on mutual agreement between the parts exchanging date strings.


If I do need to do this myself, does anybody have advice on heuristics when confronted with lots of dates in lots of formats?

Considering the diversity of date formats (ISO 8610, W3C's ISO 8610 profile, rfc822, et-cetera) you'll have to take care of this yourself.


But what's wrong with the date formatting strings? Why can't you use them? I had the impression you could create whatever format string you like.

/malte

--
Malte Tancred
Computer Programmer
Oops AB, http://oops.se/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Parsing date strings with NSDate (From: Mark Meyer <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.