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

  • Home
  • SEARCH
  • 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 7130019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:18:19+00:00 2026-05-28T11:18:19+00:00

My App is a JSON code which involves a date in string type. (Such

  • 0

My App is a JSON code which involves a date in string type. (Such as “2011-10-01”).
I would like to know how I could conver it into NSDate?
It needs to be displayed in a different time format such as “1 October, 2011”.

ex. this code doesn’t work:

   NSString *date1 = @"2010-11-12";
    NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
    [dateFormat setDateFormat:@"yyyy-MMMM-dd"];
    NSDate *date2 = [dateFormat dateFromString:date1];
    NSString *strdate = [dateFormat stringFromDate:date2];
  • 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-28T11:18:20+00:00Added an answer on May 28, 2026 at 11:18 am

    As Tug writes in his blog post on the subject:

    Objective-C and iOS SDK provide a class to help formatting date
    (marshaling and unmarshaling), this class is NSDateFormatter. No
    surprise, the NSDateFormatter uses the Unicode Date Format
    Patterns.

    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
    [dateFormatter setDateFormat:@"yyyy-MM-dd"];
    NSDate *date = [dateFormatter dateFromString:publicationDate ];
    [dateFormatter release];
    

    where publicationDate in this case is an NSString.

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

Sidebar

Related Questions

I have follwing JSON: {mykey:[{name:Jak,interests:movies}]} and following opensocial app code: <script type=text/os-template require=mykey> <ul>
I am working on an iPhone app which involves using json-framework.I am getting array
Does anybody know a good Emacs mode to edit JSON? An app I am
I have an existing app in which I added the json-framework. Now it won't
I am developing an app in asp.net in which I have jquery code in
hey, i'm new to android and i'm trying to code an app which fetches
I'm new to Android development and I'm trying to code a little app which
I have an iOS app which gets some JSON from a server (in the
I just copied some code from an asp.net mvc 2 app which works. Now
I am making an app in which i am getting a string as response

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.