Timezone and daylight savings time

Started by jsmall, October 14, 2004, 11:39:45 AM

Previous topic - Next topic

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

#1
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

#2
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