emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] dates before 1970


From: Carsten Dominik
Subject: Re: [O] dates before 1970
Date: Mon, 14 Mar 2011 11:21:36 +0100

On Mar 11, 2011, at 5:30 PM, Nick Dokos wrote:

> Carsten Dominik <address@hidden> wrote:
> 
> 
>> THis is exactly the point, that it depends on how Emacs was compiled, and 
>> what kind of integer is used in the date representation.  Signed or 
>> unsigend, 32 or 64 bits (I think).
>> 
>> For example, Bastien can represent dates before 1970. I cannot.
>> I can represent dates after 2038, Bastien cannot.
>> 
>> The work-around is to use diary sexps for dates before 1970, that seems to 
>> be safe.
>> And then hope that by 2038, all computers will use 64 bit integers....
>> 
> 
> But it's even more than that, no? Emacs's time implementation
> (current-time, encode/decode etc) would have to change. In fact, this
> might be the most significant limitation right now: the values they pass
> around are (hi16 lo16 ms) so they assume that time values are 32 bits,
> no matter what the underlying implementation says. I use 64-bit Linux on
> an x86-64 laptop and my time_t is 64 bits (but I don't know if it's
> signed or unsigned). Time for some experimentation I guess...

I believe that on your system you might get

(hi48 lo16 ms)

You can test if it is signed by trying a date before 1970

   (encode-time 0 0 0 1 1 1960)

- Carsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]