Re: Date parsing problem (when running on iphone only)
Re: Date parsing problem (when running on iphone only)
- Subject: Re: Date parsing problem (when running on iphone only)
- From: Jacob Rhoden <email@hidden>
- Date: Wed, 04 Mar 2009 23:22:57 +1100
On 4/3/09 10:15 PM, Jacob Rhoden wrote:
Anyone experience this weird behaviour with date parsing? Given the
following code, it produces a different log output when running in the
simulator or on the iPhone!!!
NSString* test = @"Monday 26 January 2009 3:47:33 pm +0000";
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setDateFormat: @"EEEE dd MMMM yyyy h:mm:ss a Z"];
NSLog(@"DATE: %@ to %i", test, [df dateFromString: test]);
This is the NSLog output on the iphone:
2009-03-04 22:08:49.645 Test[2875:20b] DATE: Monday 26 January 2009
3:47:33 pm +0000 to 0
And this on the simulator:
2009-03-04 22:09:05.095 Test[68041:20b] DATE: Monday 26 January 2009
3:47:33 pm +0000 to 5432224
It seems that if you have your Regional settings to Chinese the date is
not parsed. What is the proper way to parse an "English" formatted date?
Thanks,
Jacob
--
____________________________________________
Jacob Rhoden http://jacobrhoden.com
_______________________________________________
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