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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:26:52+00:00 2026-05-26T22:26:52+00:00

I need to convert the following format into a new format using NSDateFormatter. ‘Fri,

  • 0

I need to convert the following format into a new format using NSDateFormatter.

‘Fri, 25 Mar 2011 10:16:00 -0700’.

I tried using “aaa, dd bbb YYYY HH:MM:SS ZHHMM” as format, but it doesn’t work; it gives me a date way in the past.

I also need to convert it into the Eastern Time Zone when creating a new date.

The code I used is the following one:

NSDateFormatter *newDateFormatter = [[NSDateFormatter alloc] init]; 
[newDateFormatter setDateFormat:@"dd MMM YYYY HH:mm:SS"];
  • 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-26T22:26:53+00:00Added an answer on May 26, 2026 at 10:26 pm

    Let’s break this string down into the various portions:

    Fri, 25 Mar 2011 10:16:00 -0700 becomes:

    • Fri: abbreviated day of the week
    • 25: potentially zero-padded day of the month
    • Mar: abbreviated month
    • 2011: year
    • 10: potentially zero-padded hour (in 24-hour format because there is no AM/PM)
    • 16: potentially zero-padded minute
    • 00: zero-padded second
    • -0700: time zone offset

    Now let’s look at the date format patterns that NSDateFormatter supports:

    • abbreviated day of the week: EEE
    • zero-padded day of the month: dd
    • abbreviated month: MMM
    • year: y
    • zero-padded hour (24-hour): HH
    • zero-padded minute: mm
    • zero-padded second: ss
    • time zone offset: ZZZ

    Thus, your format string should be: @"EEE, dd MMM y HH:mm:ss ZZZ".

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

Sidebar

Related Questions

Hey everyone, I need to convert the following format into a new format using
I need to convert minutes (defined as Integer) into the following String format hh:mm
I need to convert a huge file into the following format: for each byte,
i've created a view and need to convert a datetime to following format: 2011
I need to convert all of the following forms into .NET Uri object: hello.world
I have date in following format (Y-m-d) as 2010-11-24, need to convert it to
I have s string in following format dd/MMM/YYYY:HH:mm:ss (e.g 13/Jan/2011:08:23:34 ) I need to
So I have the following assembly language code which I need to convert into
I have the following FORTRAN code which I need to convert to C or
I need to convert latitude/longitude coordinates into Easting/Northing coordinates in the Alberta 10 TM

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.