• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSDateFormatter problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDateFormatter problem


  • Subject: Re: NSDateFormatter problem
  • From: Lorenzo Thurman <email@hidden>
  • Date: Fri, 20 Apr 2012 06:59:19 -0500

On Apr 19, 2012, at 10:40 PM, Charles Srstka wrote:

> On Apr 19, 2012, at 6:38 PM, Lorenzo Thurman wrote:
>
>> This code, copied verbatim from here, http://bit.ly/HWTGB:
>>
>> 	NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
>> 	[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
>> 	[dateFormatter setTimeStyle:NSDateFormatterNoStyle];
>>
>> 	NSDate *date = [NSDate dateWithTimeIntervalSinceReferenceDate:162000];
>>
>> 	NSString *formattedDateString = [dateFormatter stringFromDate:date];
>> 	NSLog(@"formattedDateString: %@", formattedDateString);
>>
>> produces this output:
>> formattedDateString: 01/02/01
>
> That produces "formattedDateString: Jan 2, 2001" on my machine. I’d think that would have to be something in your Language & Text preferences. What do the dates look like in the Formats tab in the pref pane?
>
> Charles



I thought so as well, but that "seems" correct. I've never changed those. Not sure if a screen shot will get through, but under the Formats tab, dates and times are setup like this:
Dates:
Thursday January, 5 2012
January 5, 2012
Jan. 5 2012
1/5/12

Times:
12:34 AM 4:56 PM

To add to this mystery, I have an old build of my app that displays the date/time string in my expected format, i.e.,
Friday April 20, 2012 7:19 AM.

"...Business! Mankind was my business. The common welfare was my business; charity, mercy, forbearance, and benevolence, were all my business. The dealings of my trade were but a drop of water in the comprehensive ocean of my business!"

Marly's ghost - A Christmas Carol


Lorenzo Thurman
email@hidden




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >NSDateFormatter problem (From: Lorenzo Thurman <email@hidden>)
 >Re: NSDateFormatter problem (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: uiviewcontroller
  • Next by Date: Re: NSDateFormatter problem
  • Previous by thread: Re: NSDateFormatter problem
  • Next by thread: Displaying another page/view on button click
  • Index(es):
    • Date
    • Thread