You're trying to print an NSDate object returned by dateFromString: with a %i format which is for integers. So the number you're seeing is the memory address of the returned date converted to an int.

On Mar 4, 2009, at 4:15 AM, Jacob Rhoden wrote:

Anyone experience this weird behaviour with date formatting? 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

Im completely stuck on this one! Are are there any other easy ways to parse dates? Any help appreciated.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to