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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:51:50+00:00 2026-05-18T10:51:50+00:00

this has been driving me crazy, someone please show me where i screwed it

  • 0

this has been driving me crazy, someone please show me where i screwed it up.

I have created a new project to test this as well. Environment is xcode 3.2.5 running in the simulator and on a device has same result.

When i create a date formatter, and set its format then pass in a string, something is not working on the date formatter.

int tmpMonth = 11;
int tmpYear = 2010;
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];    
[dateFormatter setDateFormat:@"m/d/yyyy"];
NSString *dateAsString = [[NSString alloc] initWithFormat:@"%d/23/%d",tmpMonth,tmpYear];
NSDate *theDate = [[NSDate alloc] initWithTimeInterval:0 sinceDate:[dateFormatter dateFromString:dateAsString]];
[dateFormatter setDateFormat:@"MMMM d, yyyy"];
NSLog(@"%@",[dateFormatter stringFromDate:theDate]);
[dateFormatter setDateFormat:@"m/d/yyyy"];
NSLog(@"%@",[dateFormatter stringFromDate:theDate]);
[dateFormatter release];
[theDate release];
[dateAsString release];

this results in this output:

[Session started at 2010-12-03 17:47:04 -0600.]
2010-12-03 17:47:05.274 wtfDateFormatter[18970:207] January 23, 2010
2010-12-03 17:47:05.277 wtfDateFormatter[18970:207] 11/23/2010

I am not sure why it is printing January when I give it the format MMMM, as this is working just fine in other parts of my app, it just uses a different NSDate source.

  • 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-18T10:51:50+00:00Added an answer on May 18, 2026 at 10:51 am

    You’re using ‘m’ for month number, both for interpreting and generating strings. Unfortunately, ‘m’ is for minutes. Use ‘M’ instead.

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

Sidebar

Related Questions

This has been driving me crazy for the past few minutes I have a
This has been driving me crazy for 2 days. I have been trying to
This has been driving me crazy for a few days. Why doesn't the following
This has been driving me crazy! It must be something simple. Here is my
This has been driving me absolutely nuts. I have a substitute function like this:
This has been driving me crazy for the last couple of hours. I am
This has been driving me insane. I can't seem to get the RewriteMap directive
This has been driving me nuts for a few days. I am desperate for
This has been a head-banger for me. I have looked at all of the
I know this has been asked a lot, but I have a server-side custom

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.