[Python-Dev] datetime module enhancements

Sjoerd Mullender sjoerd at acm.org
Sat Mar 10 13:04:45 CET 2007


On 03/09/2007 08:56 PM, Martin v. Löwis wrote:
-- 
Sjoerd Mullender
> Christian Heimes schrieb:
>> BJörn Lindqvist schrieb:
>>> I think it should be a ValueError, given that the programmer is very
>>> likely to further use the returned timestamp to for example insert
>>> stuff in a database. Unix timestamps are not unambiguously defined for
>>> any years other than 1970 to 2038 imho.
>> IIRC the unix timestamp was originally definied as *signed* int with 32bit.
> 
> "Unix" time stamps where never defined as being 32bit. That is just an
> implementation detail. time_t was defined as an int, in second since 
> 1970, and that is all what was defined. Whether or not an int is 32bits
> depends on the hardware (and the compiler); this was never part of Unix.

As I remember, the time() system call on Version 7 Unix on the (16 bit)
PDP 11 returned the time as a C long, which on that machine was 32 bits.
 I just looked at the Version 6 Unix listing, and there too, the time is
returned as a 32 bit quantity.

I also seem to remember that in the early days, there was no such thing
as an unsigned long, so the value was necessarily signed.  But I may be
misremembering this bit.

-- 
Sjoerd Mullender



More information about the Python-Dev mailing list