Re: NSDate and millis
Re: NSDate and millis
- Subject: Re: NSDate and millis
- From: Randall Meadows <email@hidden>
- Date: Fri, 4 Apr 2008 10:15:08 -0600
On Apr 4, 2008, at 9:41 AM, Torsten Curdt wrote:
Hmmm ...doing this
NSDate *date1 = [[NSDate alloc] initWithString:@"2008-05-01
00:00:00 +0200"];
NSLog(@"date1=%@, %lf", date1, [date1 timeIntervalSince1970]);
and then using the output
date1=2008-05-01 00:00:00 +0200, 1209592800.000000
like this
NSDate* date2 = [[NSDate alloc]
initWithTimeIntervalSinceReferenceDate:1209592800L];
NSLog(@"date2=%@, %lf", date2, [date2 timeIntervalSince1970]);
gives this
date2=2132-11-06 20:46:08 +0100, 5139056768.000000
which is not exactly what I would be expecting.
What's wrong?
Nothing's "wrong"; you're just feeding mismatched data.
"ReferenceDate" != "1970".
_______________________________________________
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