[Haskell-cafe] Re: Can't do basic time operations with System.Time

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Fri Jan 21 14:09:25 EST 2005


Peter Simons <simons at cryp.to> writes:

> I was wondering: Does this calculation account for leap
> years? Does it have to?

C itself leaves unspecified the question whether its time calculations
take leap seconds into account. All other systems I know of ignore
leap seconds: POSIX C, Common Lisp, Java, .NET.

The NTP protocol also ignores leap seconds, i.e. its time is supposed
to slow down near the transition.

While supporting leap seconds is "more correct", it makes interoperability
harder: Haskell would have a different view than the rest of the system
about either the current calendar time or seconds since the Epoch.

Another problem is that leap seconds are not known further in advance
than about half of a year, so programs compiled using different
versions of Haskell would have slightly different views about the
current time.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/


More information about the Haskell-Cafe mailing list