time since the epoch

Simon Marlow simonmar@microsoft.com
Tue, 11 Feb 2003 16:47:07 -0000


[snip]
> It is always a problem to lump things with different semantics into
> the same type :-) What I'm arguing is that there should be only one
> fixed-duration offset datatype and it should be in terms of (seconds,
> picoseconds).
> Other fixed durations can be easily defined in terms of this
> datatype.=20
> I'm still not sure that you actually want base-dependent offsets, but
> again they can be easily defined on top of the fixed duration
> datatype. And they should be specified separately from the base
> functionality.
[snip]

I wrote a reply, but I don't really have anything new to say over what's
been said already, so I'll keep it brief instead.  The copy of ISO8601
that I looked at is here:
http://www.astroclark.freeserve.co.uk/iso8601/index.htm, but from what
you said I'm guessing you're looking at a different version.

Anyway, to sum up:=20

  - I agree that there should be a constant-duration time offset type.
    However, TimeDiff does actually fuction perfectly well as one at
    the moment, since diffClockTimes only fills in the seconds and
    picoseconds fields.

  - I believe a reasonable interpretation of the other fields of
    TimeDiff is as base-dependent offsets.  The current implementation=20
    in GHC doesn't do this, but you can use TimeExts which does.

  - Our implementation of ClockTime uses C's gettimeofday(), which
    apparently is based a broken definition of the epoch.  Oh well :-)

Cheers,
	Simon