bug-coreutils
[Top][All Lists]
Advanced

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

Re: coreutils-5.2.1, touch, and 64-bit time-of-day clocks


From: Paul Eggert
Subject: Re: coreutils-5.2.1, touch, and 64-bit time-of-day clocks
Date: Fri, 02 Apr 2004 13:13:49 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

"Nelson H. F. Beebe" <address@hidden> writes:

>       % touch -t 1000001010000.00 /tmp/start-of-10000
>       touch: invalid date format `1000001010000.00'

The -t option specified by POSIX doesn't allow years with more than 4
digits.  You can use the GNU -d option instead:

    touch -d '10000-01-01 00:00:00' /tmp/start-of-10000 

This should work for years less than 2**31 + 1900 (though you may find
bugs in your C library and/or coreutils).  After that, you'll need a
new syntax, which is in coreutils CVS but not coreutils 5.2.1:

    touch -d '@9223372036854775807' /tmp/start-of-10000 

> It appears that ls stops reporting years somewhere after
> 0xfffffffffffff (= 2^(52) - 1), and switches to seconds.

This is because localtime stops working once the year minus 1900
doesn't fit in 'int'.

> One can debate whether that is a feature or a bug.

Yes.  It's both a feature and a bug, to some extent.




reply via email to

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