NSDate feature request
NSDate feature request
- Subject: NSDate feature request
- From: Malte Tancred <email@hidden>
- Date: Fri, 24 May 2002 10:03:58 +0200
Hi!
The documentation for Date and Time in Cocoa states that "[the internal
implementation] do not account for leap seconds and therefore are not
synchronized with International Atomic Time (the most accurate)."
I've investigated this a bit and, to be short, it seems that the reason
for this is the constant NSTimeIntervalSince1970. The value represents
the number of seconds elapsed between 1970-01-01 00:00:00 +0000 and the
NSDate reference date 2001-01-01 00:00:00 +0000.
I've written some about it in my blog:
http://www.tancred.com/cgi-bin/blosxom/2002/May/17#taiutccocoa
If the constant were replaced by a function that calculated the number
of seconds between the unix epoch and the Cocoa reference date, NSDate
would probably operate exactely as the time() system call.
That is, if you updated your zonefiles, NSTimeIntervalSince1970 would
return the correct number of seconds, including leapseconds.
Just a thought.
Cheerio,
Malte
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.