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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:07:28+00:00 2026-06-04T13:07:28+00:00

i want to convert the string into nsdate format. here is my string NSString

  • 0

i want to convert the string into nsdate format.

here is my string NSString str=@”Sunday, June 6, 2010 5:00:00 AM CDT”;

my code is

        NSDateFormatter * Dateformats= [[NSDateFormatter alloc] init];

        [Dateformats setDateFormat:@"MM/DD/yyyy hh:mm:ss"]; //ex @"MM/DD/yyyy hh:mm:ss" 
        NSDate *myDate=[Dateformats dateFromString:str];
        NSLog(@"%@",myDate);

but it is displays null so show me the way to display the date in MM/DD/yyyy hh:mm:ss

please friends help me ,how to do this

  • 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-04T13:07:29+00:00Added an answer on June 4, 2026 at 1:07 pm

    You set your formatter to expecting a string like @"05/26/2012 8:34:00". But you give it @"Sunday, June 6, 2010 5:00:00 AM CDT". The two formats are nothing alike. It doesn’t know how to parse it and so returns nil.

    The format you want for the example string you give is EEEE, MMMM d, yyyy h:mm:ss a zzz.

    Details here and here.

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

Sidebar

Related Questions

I want to convert following string into NSDate format 2012-04-29T08:20:04Z Please help me. How
Possible Duplicate: NSString to NSDate Hi I want to convert the string OCT 1,
I have string like 123-123-1234 so I want to convert string into this format
How do I convert string 2010-11-19T20:00:00Z into an NSDate object? I've tried using [dateFormatter
i want to convert this string into DateTime. Tue Aug 19 15:05:05 +0000 2008
I want to convert all texts in a string into html entities but preserving
I want to convert a C-style string into a byte-vector. A working solution would
I want to convert a string like 2012-03-08T00:00:00+01:00 into Date.. I tried to use
i am trying to convert a LPCSTR string into LPCTSTR string. i want to
I want to convert an OutputStream into a String object. I am having an

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.