Timezone and daylight savings time

For the Compleat Fan
Locked
jsmall
Posts: 26
Joined: Mon Sep 20, 2004 1:44 am

Timezone and daylight savings time

Post by jsmall »

    (now)

returns UTC while

    (date (apply date-value (now))

returns the proper timezone corrected for daylight
savings time if the computer clock is set
to daylight savings time. Without parsing
the output of

    (date (apply date-value (now))

is there a way to determine wether or not daylight
savings time is in effect on the computer? The
reason I ask is so that I can write something like

    (set 'timezone (- 0 (last (now))))

    (now timezone)

and get back the "now" list corrected not just
for the timezone but corrected for daylight savings
time as well.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

There is a 'daylight savings time flag' in the 'tm' time structure (see time.h 'C' include file), which I could report in 'now'. Look for it in 8.2.4-development.

This may change some LISP code because the now list will grow by one member!

Lutz

jsmall
Posts: 26
Joined: Mon Sep 20, 2004 1:44 am

I solved my problem on the daylight-corrected-timezone

Post by jsmall »

Lutz,

I did a work around in the cron.lsp so that it corrects
for the timezone adjusted for daylight savings time
if the computer adjusts the clock. That way crontab
entries are good to go. The cron.lsp utility will
automatically adjust when we go on/off daylight
savings time without restarting. (If the crontab
file changes it will automatically be reloaded by
cron within 1 minute.)

John

Locked