NSDateFormatter, timezones and early dates
NSDateFormatter, timezones and early dates
- Subject: NSDateFormatter, timezones and early dates
- From: Gideon King <email@hidden>
- Date: Wed, 01 Feb 2012 14:26:50 +1000
I have just come across a really unexpected thing. I have a date formatter like so:
NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
[formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSSZ"];
Now when I use:
[formatter stringFromDate:aDate];
It works fine for dates after 1895, but for dates before that, the string is incorrect - around here it should end in +1000, but for dates before 1895, it gives +101208.
Is there some way I can get this so that it gives the expected result for all dates?
Thanks
Gideon
_______________________________________________
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