Re: NSDateFormatter problem
Re: NSDateFormatter problem
- Subject: Re: NSDateFormatter problem
- From: Charles Srstka <email@hidden>
- Date: Thu, 19 Apr 2012 22:40:21 -0500
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
_______________________________________________
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