Help me please with time functions
(CMUCL 18c).
* (format-universal-time t (get-universal-time))
Tuesday, 5/8/01 07:45:30 pm [-2]
NIL
Ok, no questions.
* (format-universal-time t (encode-universal-time 30 46 19 8 5 2001))
Tuesday, 5/8/01 07:46:30 pm [-2]
NIL
Also good.
* (format-universal-time t (parse-time "May 8, 2001 19:49:01"))
Tuesday, 5/8/01 08:49:01 pm [-2]
^^ why an hour later here ?
NIL
*
What is the matter ? Something with time zone or DST I didn't
understand ?
* (decode-universal-time (parse-time "May 8, 2001 19:52:01"))
1
52
20 <<< ??
8
5
2001
1
T
-2
*
--
Vladimir Zolotych ······@eurocom.od.ua
In article <·················@eurocom.od.ua>, Vladimir V. Zolotych wrote:
> Help me please with time functions
> (CMUCL 18c).
>
> * (format-universal-time t (get-universal-time))
> Tuesday, 5/8/01 07:45:30 pm [-2]
> NIL
> Ok, no questions.
>
> * (format-universal-time t (encode-universal-time 30 46 19 8 5 2001))
> Tuesday, 5/8/01 07:46:30 pm [-2]
> NIL
> Also good.
>
> * (format-universal-time t (parse-time "May 8, 2001 19:49:01"))
> Tuesday, 5/8/01 08:49:01 pm [-2]
> ^^ why an hour later here ?
> NIL
> *
>
> What is the matter ? Something with time zone or DST I didn't
> understand ?
>
> * (decode-universal-time (parse-time "May 8, 2001 19:52:01"))
> 1
> 52
> 20 <<< ??
> 8
> 5
> 2001
> 1
> T
> -2
> *
>
> --
> Vladimir Zolotych ······@eurocom.od.ua
Could it be daylight savings time has something to do with it?
marc
"Vladimir V. Zolotych" <······@eurocom.od.ua> writes:
> * (format-universal-time t (get-universal-time))
> Tuesday, 5/8/01 07:45:30 pm [-2]
> NIL
> Ok, no questions.
>
> * (format-universal-time t (encode-universal-time 30 46 19 8 5 2001))
> Tuesday, 5/8/01 07:46:30 pm [-2]
> NIL
> Also good.
>
> * (format-universal-time t (parse-time "May 8, 2001 19:49:01"))
> Tuesday, 5/8/01 08:49:01 pm [-2]
> ^^ why an hour later here ?
> NIL
> *
The problem is that CMUCL's parse-time doesn't take into account
daylight-savings time for defaulted formats. Hence it gets the
universal time it calculates wrong by an hour during DST, for all
formats which don't specify enough time-zone information that
defaulting isn't necessary.
I'll have a look if this can be fixed easily, but parse-time is a
non-trivial code-base, and some rewriting will be necessary, I fear.
Regs, Pierre.
--
Pierre R. Mai <····@acm.org> http://www.pmsf.de/pmai/
The most likely way for the world to be destroyed, most experts agree,
is by accident. That's where we come in; we're computer professionals.
We cause accidents. -- Nathaniel Borenstein