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



Use NSCalendarDate instead, it is better suited for converting different date formats.

Joakim

On 2004-12-14, at 08.52, Mark Meyer wrote:

Hello,

I am trying to read date strings from various documents using NSDate. The dateWithNaturalLanguageString is very handy, but I can't seem to find anything in the API that handles ISO 8601 dates. 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. It seems odd that I can easily parse dates like "last tuesday' but can't parse a date in an ISO format. So before I go off to subclass hell I thought I would check to make sure I am not missing anything obvious.

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

Thanks

_______________________________________________
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


_______________________________________________ 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.