Time Resolution

Simon Marlow simonmar at microsoft.com
Wed Feb 2 04:32:43 EST 2005


On 02 February 2005 07:25, Ashley Yakeley wrote:

> In article <ashley-EF0986.17424301022005 at sea.gmane.org>,
>  Ashley Yakeley <ashley at semantic.org> wrote:
> 
>> It looks like we may need three types here:
>> 
>> * one for TAI
>> 
>> * one for POSIX time, which is a broken encoding of UTC
>> 
>> * one for correct encoding of UTC
> 
> This is the sort of thing I mean:
> 
>   newtype TAITime = TAITime Integer deriving (...)
> 
>   newtype POSIXTime = POSIXTime Integer deriving (...)
> 
>   newtype DiffTime = DiffTime Integer deriving (...)
> 
>   type JulianDay = Integer
> 
>   data UTCTime = UTCTime JulianDay DiffTime
> 
>   getCurrentTime :: IO POSIXTime
> 
>   posixToUTCTime :: POSIXTime -> UTCTime

Why does the user of the library care about the difference between UTC,
TAI and POSIX time?  The only way I can think that this really needs to
be exposed to the programmer is so that they can tell the library
whether the system clock is running POSIX or TAI time.  For the library
API, a single notion of time is sufficient, no?

Cheers,
	Simon


More information about the Libraries mailing list