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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:36:25+00:00 2026-06-01T06:36:25+00:00

i have a function to convert into NSDate by using NSDateFormatter . +(NSDate*)getDateFromCurrentTimestamp:(NSString*)currentTimestamp{ //

  • 0

i have a function to convert into NSDate by using NSDateFormatter.

+(NSDate*)getDateFromCurrentTimestamp:(NSString*)currentTimestamp{
//    currentTimestamp= @"28-Feb-2012 16:42:19 PM";

    NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
    [dateFormatter setDoesRelativeDateFormatting:NO];
    [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
    [dateFormatter setFormatterBehavior:NSDateFormatterShortStyle];
    //[NSDateFormatter setDefaultFormatterBehavior:NSDateFormatterBehaviorDefault];
    [dateFormatter setDateFormat:@"dd-MMM-yyyy HH:mm:ss a"];

    return [dateFormatter dateFromString:currentTimestamp];
}

IOS 5.x is returned correct NSDate.
when run on 4.1 & 4.2 also returned correct NSDate.
when run on 4.3.2 & 4.3.3, it’s returned null.

how is it possible? any workaround of this?


EDIT

This is not caused by iOS bug. this is related to phone itself. some phone has different locale set in device. so we had to force it to use one locale.

  • 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-01T06:36:26+00:00Added an answer on June 1, 2026 at 6:36 am

    From our discussion in the comments:

    Are your region and locale set for the 4.3.2 & 4.3.3 devices? See if this SO question helps.

    Relevant code:

    [dateFormatter setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_GB"] autorelease]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function to convert documents into different formats, which then calls another
I have a function (tointarray) to convert a string into an array of ints,
I have a function in Java which I need to convert into php. It
I have written a function to convert a date into a Unix time stamp.
How can I convert text into link using jQuery and assign a function? I
I have created a function which will convert any string into tab delimited. What's
I have a function to convert the first 3 letters of the month into
I have one function in oracle i need to convert it into c# code
I'd like to have a standard function that will convert relative paths into absolute
I have a function that converts 60000 into 60k or 60100 into 60.1k But

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.