Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5967965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:01:15+00:00 2026-05-22T20:01:15+00:00

I would like to parse ISO8601 dates in Cocoa, both for iOS 4+ and

  • 0

I would like to parse ISO8601 dates in Cocoa, both for iOS 4+ and OSX 10.6+

There are a few questions about this on StackOverflow already, but in my opinion none of them contain good answers. Here’s what I think constitutes a good answer:

  1. The answer should point to code with support for ISO8601. This code should compile cleanly under XCode 4 for both iOS 4+ and OSX 10.6+.

  2. The code should support all possible ISO8601 date formats.

    Please note that there are many, many possibilities here. Simply answering with one or two format strings for NSDateFormatter is not going to cut it.

  3. The answer should not be this library. That’s because it is riddled with dangerous 32-bit assumptions, it’s far more complicated than necessary, and it doesn’t compile clean with XCode4/Clang. Bottom line: I don’t trust it at all!

Thanks, fellow Cocoa-ites. I’m excited to find out if there’s a real answer here!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:01:16+00:00Added an answer on May 22, 2026 at 8:01 pm

    The best way is this library. ☺

    I should add a link on that page to the Bitbucket repo, which contains newer source code (including 32-bit and Clang fixes!) and has an issue tracker. If you find any other bugs in it, please file them.

    I’d also like to know what you mean by “more complicated than necessary”. Normal usage is very simple:

    ISO8601DateFormatter *formatter = [[[ISO8601DateFormatter alloc] init] autorelease]; //Or, if you prefer, create it once in -init and own it until -dealloc 
    NSDate *parsedDate = [formatter dateFromString:inString];
    NSString *unparsedString = [formatter stringFromDate:inDate];
    

    You can switch out dateFromString: or stringFromDate: for one of the longer methods if you need more information (e.g., to preserve the time zone).

    If you mean something else, I want to hear it so I can improve the library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know if there is a simple way to parse HTML
i would like to parse out some text from a page. Is there an
I would like to parse a table using Nokogiri. I'm doing it this way
I would like to parse a date like this 1.09.2011? Should I use the
I would like to parse through jquery. When I want to parse, there is
I would like to parse a string such as p1=6&p2=7&p3=8 into a NameValueCollection .
I would like to parse a document using SAX, and create a subdocument from
I would like to know the procedure to adopt to parse and obtain text
I have dates in the format 2008-12-23T00:00:00Z . This look a lot like a
I would like parse data from google maps geocode version 3 through json. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.