Lisp HUG Maillist Archive

Encoding universal time

I just noticed that

CL-USER 1 > (= (encode-universal-time 0 0 0 1 1 9)
               (encode-universal-time 0 0 0 1 1 2009))
T

CL-USER 2 > (symbol-package 'encode-universal-time)
#<The COMMON-LISP package, 3/4 internal, 978/1024 external>

CL-USER 3 >

which surprises me.  I don't see how that can be correct, can anyone enlighten me?

I am using LWM 6.0.0.

-Klaus.

Re: Encoding universal time

On Tue, Mar 9, 2010 at 10:09 AM, Espen Vestre <ev@netfonds.no> wrote:
It's according to the standard. See 25.1.4.1 in the Hyperspec!
 --
 (espen)

Thanks.  Over time I have really learned to appreciate working in a thoroughly specified language (even if I don't always know where to find things in the spec!).

-Klaus.

Re: Encoding universal time

Klaus Harbo <klaus@harbo.net> writes:

> I just noticed that
>
> CL-USER 1 > (= (encode-universal-time 0 0 0 1 1 9)
>                (encode-universal-time 0 0 0 1 1 2009))

It's according to the standard. See 25.1.4.1 in the Hyperspec!

-- 
  (espen)


Re: Encoding universal time

"Ralf P. Gans" <Ralf.Gans@T-Online.de> writes:

> As I understood the hyperspec, 0 would be 2100, right?

No, it says "within fifty years of the current year".

-- 
  (espen)


Re: Encoding universal time

"Ralf P. Gans" <Ralf.Gans@T-Online.de> writes:

> Hello,
>
> I'm more a schemer and just watching this newsgroup,
> but this has just jumped at me.
>
> How would I address the Years 0 to 99?
>
> Thank you,
>
> Ralf

According to the standard, you can't, since universal time is positive
and the value 0 is in the year 1900. 

However, lispworks lets you work with negative universal time. I'm not
sure how far back the calendar is actually correct, though (but I
assume it will you Gregorian dates for times when the Gregorian
calendar wasn't invented yet :-)).
-- 
  (espen)


Updated at: 2020-12-10 08:39 UTC