[Top][All Lists]

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

Re: date command

From: Bob Proulx
Subject: Re: date command
Date: Tue, 11 Jun 2002 19:15:57 -0600
User-agent: Mutt/1.3.28i

> date +%s --date="20380120"
> gets Invalid date?
> Why can't I get the date in seconds for 20th of Janurary 2038?

Because your operating system is using a 32-bit value for time_t and
that date overflows the value that it can hold in seconds since Jan 1,
1970.  This is one of the reasons why Y2K was not a huge deal for
32-bit unix machines.  The real rollover is in 2038.

In order to handle dates past 2038 you need an operating system that
uses 64-bit sized time_t structures.  The theory would go that by the
time we get to 2038 32-bit machines will be old and obsolete and even
your watch would be at least 64-bit.  :-)


reply via email to

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