Alan Riggins wrote:
> 
> 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

Thanks.  That clears it up.

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

Reply via email to