• 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: Parsing date strings with NSDate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing date strings with NSDate


  • Subject: Re: Parsing date strings with NSDate
  • From: Joakim Danielson <email@hidden>
  • Date: Tue, 14 Dec 2004 12:27:46 +0100

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:
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: This email sent to email@hidden
References: 
 >Parsing date strings with NSDate (From: Mark Meyer <email@hidden>)

  • Prev by Date: Carbon-style AppleScript support in Cocoa
  • Next by Date: [ANN] Pasteboard Observer Application
  • Previous by thread: Parsing date strings with NSDate
  • Next by thread: Re: Parsing date strings with NSDate
  • Index(es):
    • Date
    • Thread