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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:00:21+00:00 2026-06-03T16:00:21+00:00

How to convert the Date String 2012-05-03 06:03:00 +0000 to NSDate. I user the

  • 0

How to convert the Date String “2012-05-03 06:03:00 +0000” to NSDate. I user the code below, but it does not work:

NSDateFormatter *datFormatter = [[NSDateFormatter alloc] init];
[datFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss Z"];
NSDate* date = [datFormatter dateFromString:dateStr];
  • 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-06-03T16:00:24+00:00Added an answer on June 3, 2026 at 4:00 pm
      NSString *dateStr = @"2012-05-03 06:03:00 +0000";
      NSDateFormatter *datFormatter = [[NSDateFormatter alloc] init];
      [datFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss Z"];
      NSDate* date = [datFormatter dateFromString:dateStr];
      NSLog(@"date: %@", [datFormatter stringFromDate:date]);
    

    This code prints date: 2012-05-03 09:03:00 +0300

    It works. Also don’t forget to set the date formatter’s timeZone that you’re targeting

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

Sidebar

Related Questions

I have this piece of code: // Convert string to date object NSDateFormatter *dateFormat
I want to convert a string like 2012-03-08T00:00:00+01:00 into Date.. I tried to use
When trying to convert date/time from string to DateTime, I'm not getting the correct
I have a date in this string format 02/28/2012 and I want to convert
Possible Duplicate: Conversion from string “31/03/2012” to type 'Date' is not valid I tried
I'm trying to convert following text to Date but not able to get it
I have a string 2012-09-16 23:59:59 JST I want to convert this date string
How does one convert a string of a date without a year to a
Possible Duplicate: convert string to nsdate The NSString has following value '2012-07-11T15:59:16' I am
The code below fails to extract the date text and convert it - that's

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.