lkml.org 
[lkml]   [1998]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectOff-topic year-2000
Investigation of Y2K stuff has shown....
With the following program:

#include <stdio.h>
#include <time.h>

main()
{
time_t tim;
struct tm *t;
tzset();
for(tim = 0x386d89c0; tim < 0x386d89d2L; tim++)
{
t = localtime(&tim);
printf("%08lX %s", tim, asctime(t));
}
return 0;
}

Linux 2.1.70 with libc-5.3.12 shows....

386D89C0 Fri Dec 31 23:59:44 1999
386D89C1 Fri Dec 31 23:59:45 1999
386D89C2 Fri Dec 31 23:59:46 1999
386D89C3 Fri Dec 31 23:59:47 1999
386D89C4 Fri Dec 31 23:59:48 1999
386D89C5 Fri Dec 31 23:59:49 1999
386D89C6 Fri Dec 31 23:59:50 1999
386D89C7 Fri Dec 31 23:59:51 1999
386D89C8 Fri Dec 31 23:59:52 1999
386D89C9 Fri Dec 31 23:59:53 1999
386D89CA Fri Dec 31 23:59:54 1999
386D89CB Fri Dec 31 23:59:55 1999
386D89CC Fri Dec 31 23:59:56 1999
386D89CD Fri Dec 31 23:59:57 1999
386D89CE Fri Dec 31 23:59:58 1999
386D89CF Fri Dec 31 23:59:59 1999
386D89D0 Sat Jan 1 00:00:00 2000
386D89D1 Sat Jan 1 00:00:01 2000
(correct)

Linux 2.1.70 with glibc-2.0.5 shows:

386D89C0 Sat Jan 1 04:59:44 2000
386D89C1 Sat Jan 1 04:59:45 2000
386D89C2 Sat Jan 1 04:59:46 2000
386D89C3 Sat Jan 1 04:59:47 2000
386D89C4 Sat Jan 1 04:59:48 2000
386D89C5 Sat Jan 1 04:59:49 2000
386D89C6 Sat Jan 1 04:59:50 2000
386D89C7 Sat Jan 1 04:59:51 2000
386D89C8 Sat Jan 1 04:59:52 2000
386D89C9 Sat Jan 1 04:59:53 2000
386D89CA Sat Jan 1 04:59:54 2000
386D89CB Sat Jan 1 04:59:55 2000
386D89CC Sat Jan 1 04:59:56 2000
386D89CD Sat Jan 1 04:59:57 2000
386D89CE Sat Jan 1 04:59:58 2000
386D89CF Sat Jan 1 04:59:59 2000
386D89D0 Sat Jan 1 05:00:00 2000
386D89D1 Sat Jan 1 05:00:01 2000
(incorrect)

SunOs 5.5.1 shows:
386D89C0 Fri Dec 31 23:59:44 1999
386D89C1 Fri Dec 31 23:59:45 1999
386D89C2 Fri Dec 31 23:59:46 1999
386D89C3 Fri Dec 31 23:59:47 1999
386D89C4 Fri Dec 31 23:59:48 1999
386D89C5 Fri Dec 31 23:59:49 1999
386D89C6 Fri Dec 31 23:59:50 1999
386D89C7 Fri Dec 31 23:59:51 1999
386D89C8 Fri Dec 31 23:59:52 1999
386D89C9 Fri Dec 31 23:59:53 1999
386D89CA Fri Dec 31 23:59:54 1999
386D89CB Fri Dec 31 23:59:55 1999
386D89CC Fri Dec 31 23:59:56 1999
386D89CD Fri Dec 31 23:59:57 1999
386D89CE Fri Dec 31 23:59:58 1999
386D89CF Fri Dec 31 23:59:59 1999
386D89D0 Sat Jan 1 00:00:00 2000
386D89D1 Sat Jan 1 00:00:01 2000
.... Which is the same as Linux with libc-5.3.12

The current time, set by (void)time(&tim); in the program is correct
in all cases and does not show the 5-hour difference. The 5-hour
difference is likely caused by our 5-hour offset from GMT, but it
doesn't show such an offset when using the current time, only in
the future time.

My TZ variable is set as TZ=EST and is exported. Removing it makes
the time GMT so I know it's being checked and included in the
calculations.

So this is something that has to be looked at within the next two
years <grin>.

Cheers,
Dick Johnson
***** FILE SYSTEM MODIFIED *****
Penguin : Linux version 2.1.70 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.


\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.099 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site