I think the problem with your calculation is that you assumed the date
variable is unsigned.
Looking at /usr/include/time.h:
#ifndef _TIME_T
#define _TIME_T
typedef long time_t;
#endif
#ifndef _CLOCK_T
#define _CLOCK_T
typedef long clock_t;
#endif
Since it's a signed 32bit number then it would overflow sometime around 2038.
(2^32)/2 = 2147483648
60 sec * 60 min * 24 hrs * 365.25 days = 31471200 sec in a year
2147483648 / 31471200 = 68.24 years.
1970 + 68 = 2038
Alan Riggins
--------------------------------------------------
George Toft wrote:
> [EMAIL PROTECTED] wrote:
> [snip]
> > Technical Information - August 1998
> >
> > System Programs
> >
> > The kernel and core tools of Linux and other Unix-like operating systems
> > do not store dates in a two-digit format. Time is counted in number of
> > seconds since January 1, 1970. A 32-bit system such as x86 Linux should
> > thus have no date problems through the year 2038.
> [snip]
>
> Clue me in. 2^32 = 4294967296. Divide that by 60 (for
> seconds),
> 60 (for minutes), 24 (for hours), and 365.24 (rough
> approximation
> for years), and you get 136.1030271 years. 1970 + 136 is
> the
> year 2106.
>
> Any kernel hackers out there to help out?
>
> George
>
> -
> To get out of this list, please send email to [EMAIL PROTECTED] with
> this text in its body: unsubscribe suse-linux-e
> Check out the SuSE-FAQ at http://www.suse.com/Support/Doku/FAQ/ and the
> archiv at http://www.suse.com/Mailinglists/suse-linux-e/index.html
-
To get out of this list, please send email to [EMAIL PROTECTED] with
this text in its body: unsubscribe suse-linux-e
Check out the SuSE-FAQ at http://www.suse.com/Support/Doku/FAQ/ and the
archiv at http://www.suse.com/Mailinglists/suse-linux-e/index.html