At 10:37 AM 8/16/00 -0400, Chaim Frenkel wrote:
> >>>>> "BB" == Buddha Buck <[EMAIL PROTECTED]> writes:
>
>BB> If we have to pick and epoch in an OS-neutral way, I think I for one
>BB> would be happy with something like this in the docs for the time
>BB> functions:

Would you be happy with the following edits?

>BB> --------------------
>BB> All date and time functions, unless otherwise documented, assume the
>BB> use of the International Atomic Time (TAI) timescale. TAI differs from
>BB> standard time (UTC) in that TAI does not have "leapseconds".
>
>BB> It is likely that the OS clock was set to UTC, not TAI.  This slight
>BB> difference (22 seconds as of 2000) should not cause any problems unless
>BB> date computations of over 6-months with second accuracy are needed.
>
>BB> time() returns the number of seconds elapsed since the beginning of the
>BB> International Atomic Time (TAI) timescale, 00:00:00 UTC 1 January 1958.

time() assumes that the system clock is set to TAI, and does not correct 
for accumulated leap-seconds.  Arithmetic differences between time stamps 
made using time() may be off by the number of accumulated leap seconds 
between the two time stamps.

>BB> date($) returns a year-month-day-hour-minute-second representation of
>BB> the time passed to it (in seconds since the TAI epoch).  The
>BB> representation assumes the TAI timescale.
>BB> ---------------------
>
>So if I understand you, the instantaneous time is correct. But
>calculating backwards to what the instantaneous time would have been,
>or calculating what the instanataneous time will be will not work.

Exactly.

>But your blurb would be a lie. How would one ensure the correct
>difference to the TAI? And what would be the translation to the
>system time?

Unless you want to have to update perl (or a configuration option) every 
year, it's probably best to not bother correcting for leap seconds.

This is essentially what we do now.  The major change here would be a 
change of epoch (to the TAI epoch) and a documentation of the issues involved.

>What do we do with stat(), utime(), sleep(), select(), events, etc.

stat() returns time stamps (made in the past).  utime() sets time 
stamps.  They should be compatible with time().  e.g., "utime 
time,time,@files" should still set the modify and access times of @files to 
"now".

sleep(), select() both take intervals.  The time scale is irrelevant.

Will events need time stamps, intervals, or other (please specify)?


><chaim>
>--
>Chaim Frenkel                                        Nonlinear Knowledge, Inc.
>[EMAIL PROTECTED] 
>+1-718-236-0183

Reply via email to