it appears there is a bug in Apple's date formatter:

                        NSDateFormatter *inputFormatter = [[NSDateFormatter 
alloc] init];
                        [inputFormatter setDateFormat:@"MMM-dd-yy HH:mm:ss 
zzz"];
NSDate *theDate = [inputFormatter dateFromString:@"Apr-04-09 10:30:03 PDT"];

this gives the wrong timezone in "theDate"??? (unless of course you happen to be in the PDT timezone) it looks like it ignores the format, and just puts in current time zone. it should be -0700 at the end of the "theDate" if you look at it in a debugger, but it is wrong for anyone that is not in the PDT...


                        NSDateFormatter *inputFormatter = [[NSDateFormatter 
alloc] init];
                        [inputFormatter 
setFormatterBehavior:NSDateFormatterBehavior10_4];
[inputFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]]; [inputFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT: 0]];
                        [inputFormatter setDateFormat:@"MMM-dd-yy HH:mm:ss 
zzz"];
                        
NSDate *theDate = [inputFormatter dateFromString:@"Apr-04-09 10:30:03 PDT"];

this gives me a NIL in "theDate" because timeZoneForSecondsFromGMT is some how not working, or i have it wrong.....

also using the natural language formater properly gives me the correct time Zone, but as soon as you store it in a Data Source, it comes back out with the current time zone, and the time adjusted so that it is correct time at least... but this shouldn't happen? should it.

Jon.

_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to