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: Tue, 15 Mar 2011 08:24:24 +0100

On Mar 14, 2011, at 7:12 PM, Achim Gratz wrote:

> Nick Dokos <address@hidden> writes:
>> I was referring to the C code implementing current-time (which, btw, has been
>> changed in latest):
>> 
>> ,----
>> | DEFUN ("current-time", Fcurrent_time, Scurrent_time, 0, 0, 0,
>> |        doc: /* Return the current time, as the number of seconds since 
>> 1970-01-01 00:00:00.
>> | The time is returned as a list of three integers.  The first has the
>> | most significant 16 bits of the seconds, while the second has the
>> | least significant 16 bits.  The third integer gives the microsecond
>> | count.
>> | 
>> | The microsecond count is zero on systems that do not provide
>> | resolution finer than a second.  */)
>> |   (void)
>> | {
>> |   EMACS_TIME t;
>> | 
>> |   EMACS_GET_TIME (t);
>> |   return list3 (make_number ((EMACS_SECS (t) >> 16) & 0xffff),
>> |            make_number ((EMACS_SECS (t) >> 0)  & 0xffff),
>> |            make_number (EMACS_USECS (t)));
>> | }
>> `----
> 
> I can't see how this code works correctly unless it is guaranteed that
> EMACS_TIME is 32bit unsigned...

Yes, I agree.  However, I am just realizing that using 32 bit unsigned
for (current-time) is fine for a loong time to come.  So the issue
if *Org* can handle dates outside the safe range is is not about
`current-time' at all, but about what encode-time, decode-time,
time-subtract, time-add etc do, what kind of integers they can handle.

- Carsten

> 
> 
> Achim.
> -- 
> +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
> 
> Waldorf MIDI Implementation & additional documentation:
> http://Synth.Stromeko.net/Downloads.html#WaldorfDocs
> 
> 

- Carsten






reply via email to

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