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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:04:41+00:00 2026-06-13T12:04:41+00:00

Possible Duplicate: NSDate / NSDateFormatter returning GMT on iPhone iOS 4.3 When the following

  • 0

Possible Duplicate:
NSDate / NSDateFormatter returning GMT on iPhone iOS 4.3

When the following code is executed

NSString *inputDateString=@"2012-10-19 19:37:54";
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSDate *test=[formatter dateFromString:inputDateString];

the value of “test” is 2012-10-19 23:37:54 +0000 rather than a date value equivalent to the inputDateString. Why is the date being converted to GMT?

EDIT: How do I take an input string date and and convert it to an equivalent NSDate object?

  • 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-13T12:04:42+00:00Added an answer on June 13, 2026 at 12:04 pm

    NSDate doesn’t store timezones, nor does it care about them. NSDate only stores the time that has passed since a given reference date (january 1st 2001). When you use your NSDateFormatter like this, it will assume that the timezone of the date matches the users current timezone when converting the string to the date object, however, when you use NSLog to check the date, it doesn’t have any timezone information. Keep in mind though, that the date is still correct and equal to the input value.

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

Sidebar

Related Questions

Possible Duplicate: convert string to nsdate The NSString has following value '2012-07-11T15:59:16' I am
Possible Duplicate: Converting NSString to NSDate (and back again) I'm still beginner at obj-C/iOS
Possible Duplicate: NSString to NSDate I am developing one application in that i am
Possible Duplicate: NSString to NSDate How to parse a date string into an NSDate
Possible Duplicate: NSString to NSDate Hi I want to convert the string OCT 1,
Possible Duplicate: Convert NSString of a date to an NSDate I need some help
Possible Duplicate: Wrong time from NSDateFormatter NSDate is 5 hours off I am trying
Possible Duplicate: NSDateFormatter and yyyy-MM-dd I have an NSDate variable in format yyyy-MM-dd that
Possible Duplicate: Converting NSString to NSDate (and back again) I have a NSString representation
Possible Duplicate: Concatenate Two NSDate String values Just confused that is there any default

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.