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 7623013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:35:54+00:00 2026-05-31T04:35:54+00:00

I am attempting convert this string 2012-02-05T00:00:00+00:00 into a more attractive, nicely formatted string

  • 0

I am attempting convert this string “2012-02-05T00:00:00+00:00” into a more attractive, nicely formatted string like “Tuesday March 5, 2012.

I have an example that I’m working from:

NSString *dateStr = @"20081122";

// Convert string to date object
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyyMMdd"];
NSDate *date = [dateFormat dateFromString:dateStr];  

// Convert date object to desired output format
[dateFormat setDateFormat:@"EEEE MMMM d, YYYY"];
dateStr = [dateFormat stringFromDate:date];
NSLog(@"date: %@", dateStr);
[dateFormat release];

How would I accommodate for the date format “2012-02-05T00:00:00+00:00” using similar code above?

Thank you.

  • 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-31T04:35:56+00:00Added an answer on May 31, 2026 at 4:35 am

    When i see your time “2012-02-05T00:00:00+00:00”, I think you are printing a “NSDate” into your console. In that time “2012-02-05” is a date and “T00:00:00+00:00” is a time. So when you need to use date like this,

    NSString *dateStr = @"2012-02-05";
    

    you have to format like this

    [dateFormat setDateFormat:@"yyyy-MM-dd"];
    

    If you want to convert the date component into as you liked try this

    NSString *dateStr = @"2012-02-05";
    
    // Convert string to date object
    NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
    [dateFormat setDateFormat:@"yyyy-MM-dd"];
    NSDate *date = [dateFormat dateFromString:dateStr];  
    
    // Convert date object to desired output format
    [dateFormat setDateFormat:@"EEEE MMMM d, YYYY"];
    dateStr = [dateFormat stringFromDate:date];  
    NSLog(@"%@",dateStr);
    

    You can even do like this to convert the current date into as you like.

    // Convert date object to desired output format
    [dateFormat setDateFormat:@"EEEE MMMM d, YYYY"];
    dateStr = [dateFormat stringFromDate:[NSDate date]]; //for current date  
    NSLog(@"%@",dateStr);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to convert a float into a string. I have a string
I have to convert a generic object(s) into a NameValueCollection. I am attempting to
I'm attempting to convert a string to a TStream. My code below gives me
Have been reading about async and tasks and been attempting to convert the CopyFileEx
I'm attempting to use Python to convert a multi-page PDF into a series of
I'm attempting to take an NSImage and convert it to a string which I
I'm writing some code to parse a string into a double, but this string
Attempting to take the data in my gridview and convert it back into a
I am carefully treading into WCF attempting to follow tutorials and convert my ASMX
I'm attempting to convert a string from CP932 (aka Windows-31J) to utf8 in javascript.

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.