Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDate's GMT offset changing with month change.



I create two NSDates, but the only difference is the month, but the
hour and GMT offset changes, why?


The code:

int main (int argc, const char * argv[])
{
   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

	NSDate *dateOne = [NSDate dateWithString:@"2006-9-02 7:30:12 -0700"];
	NSDate *dateTwo = [NSDate dateWithString:@"2006-1-02 7:30:12 -0700"];
	
	NSLog(@"dateOne: %@", [dateOne description]);
	NSLog(@"dateTwo: %@", [dateTwo description]);
	
   [pool release];
   return 0;
}

The output:

2006-09-30 14:54:39.012 NSDateTest[6958] dateOne: 2006-09-02 07:30:12 -0700
2006-09-30 14:54:39.013 NSDateTest[6958] dateTwo: 2006-01-02 06:30:12 -0800
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.