Re: invalid date from date -d 1969-12-31
On Tue, Jan 28, 2003 at 03:14:10PM -0600, Ron Johnson wrote:
>On Tue, 2003-01-28 at 09:32, George Georgalis wrote:
>> On Mon, Jan 27, 2003 at 11:36:36PM -0800, Eric G. Miller wrote:
>> >On Mon, Jan 27, 2003 at 10:59:47PM -0500, Stan Heckman wrote:
>> >> On my system, date -d returns "invalid date" for dates before 1970. It
>> >> is possible that this began when I upgraded libc6. Any suggestions?
>> >
>> >1970-01-01 is time zero for *nixen. You're asking about what happened
>> >before the big bang! Guess "date" is not as generally useful for
>> >reformatting dates as it could be. However, its primary function is to
>> >set/print the current date/time which is always more recent than 1970.
>>
>> Guess again. It works fine here... debian 3.0r1
>> $ date -d "1/15/1905"
>> Sun Jan 15 00:00:00 EST 1905
>> $ date -d "1/15/1905" +%s
>> -2049994800
>>
>> Wouldn't surprise me if I couldn't set my clock to negative Unix time
>> though.
>>
>> <my guess> try "export LC_TIME=C" or better yet "export LC_ALL=C" man
>> locale for details. </my guess>
>
>$ date -d "1/15/1905"
>date: invalid date `1/15/1905'
>
>$ LC_TIME=C date -d "1/15/1905"
>date: invalid date `1/15/1905'
>
>$ LC_ALL=C date -d "1/15/1905"
>date: invalid date `1/15/1905'
Well that's not it then... and i'm stretched to thin trying to share
posts on two lists. I was hoping someone would just be familiar with
the problem and the fix. The consensus is, check your version. This one
works:
$ date --version
date (GNU sh-utils) 2.0.11
Written by David MacKenzie.
but maybe it's the kernel that's been fixed, I know there has been some
clock work (duh) but I don't even remember what it was about or when
(like I said duuuh). in any event I'm getting pre 1970 dates with kernel
2.4.20.
// George
--
GEORGE GEORGALIS, System Admin/Architect cell: 347-451-8229
Security Services, Web, Mail, mailto:george@galis.org
Multimedia, DB, DNS and Metrics. http://www.galis.org/george
Reply to: