0

Possible Duplicate:
Is there a simple way of converting an ISO8601 timestamp to a formatted NSDate?

I can't convert this NSString to an NSDate: 2010-03-06T10:06:00-05:00

To be honest, I can not decipher the Unicode docs, where they talk about generic wall time , standard/daylight time, offsets from GMT as a fallback, etc.

To show that I have made a decent effort, here is what I have as the dateformatter: yyyy-MM-dd'T'HH:mm:ssZZ:ZZ"

If I strip out the timezone such that the date becomes 2010-03-06T10:06:00 then I know what to do. But how many letter "Z"s do I need, and are they upper case? Should I be removing the colon from the -05:00 ? The timezone has been my achilles heel with these conversions.

Could someone please help me out?

Thank you!

Community
  • 1
  • 1
user798719
  • 9,619
  • 25
  • 84
  • 123
  • http://stackoverflow.com/questions/2201216/is-there-a-simple-way-of-converting-an-iso8601-timestamp-to-a-formatted-nsdate?rq=1 – user798719 Aug 25 '12 at 05:03
  • http://stackoverflow.com/questions/2201216/is-there-a-simple-way-of-converting-an-iso8601-timestamp-to-a-formatted-nsdate?rq=1 seems to be the same question. – user798719 Aug 25 '12 at 05:04

1 Answers1

1

Have a look at this ISO 8601 date formatter and see if that works for you.

nneonneo
  • 171,345
  • 36
  • 312
  • 383