# Time handling in CPL (was: Re-entrant, any-zone mktime()-equivalent?)

Alex LIVINGSTON alex at agsm.edu.au
Fri Nov 17 02:00:41 UTC 2000

```At 17:54 -0500 2000-11-16, Jonathan Lennox wrote:
>...stated either as something like "2000-11-16, 10 pm - 2000-11-17,
>7am; repeat daily" or as something like "2000-11-16, 10 pm, for 9
>hours; repeat daily"...I felt it was
>much more likely that the semantics of the two cases are actually intended
>to be the same thing; and having a phone ring at 6:30 am on April 1st, or
>having it not ring at 7:30 am on October 28, 2001, would violate the
>principle of least surprise.

Shouldn't that be the other way around? Namely:

"...having a phone not ring at 7:30 am on April 1st, or having it
ring at 6:30 am on October 28, 2001..."

I'm also puzzled by:

At 18:35 -0800 2000-11-15, Paul Eggert wrote:
>Suppose the current time zone is America/Los_Angeles, the time of the
>call is 2000-04-02 01:30 -0800 (PST), and you have a two-hour time
>like "time slot".)  Since you use standard Gregorian time, I guess
>you'll say that 2000-04-02 03:45 -0700 falls within the two-hour time
>slot.  But 03:45 actually is only 1 hour and 15 minutes after the time
>of the call, due to a DST change.  Is that what the user wants?

Isn't 03:45 more than 2 hours after 01:30 (all other things being
equal) and thus _outside_ the two-hour time slot? The fact that in
the example it's only 1 hour 15 minutes later (instead of 2 hours 15
minutes later) because of a time-offset change brings it _within_ the
two-hour time slot, doesn't it? Am I just misunderstanding what a
time slot is and what's within it and what's not?

Sorry if I'm making too much fuss over what are possibly insignificant errors.

--Alex
_______________
Alex LIVINGSTON
Macintosh and Lotus Notes Support / Information Technology (IT)
Australian Graduate School of Management (AGSM)
UNSW SYDNEY NSW 2052 / Australia

Facsimile: +61 2 9931-9349 / Telephone: +61 2 9931-9264
Time     : UTC+11---[last Mar. Sun.---UTC+10---[last Aug. Sun.---UTC+11---

At end of today, Friday, November 17,
time since epoch (1-1-1 at 00:00:00)
= 730441 days = 1999.87953209 average Gregorian years
time until 3rd millennium, 21st century, 201st decade, 2001st year
= 44 days = .12046791 average Gregorian years

```