Thursday, January 06, 2005

Slashdot | Y2K: Hoax, Or Averted Disaster?

Slashdot | Y2K: Hoax, Or Averted Disaster?: "A little perl script you can use on your server to check if you are already 2038 ready:

#!/usr/local/bin/perl

use POSIX;
$ENV{'TZ'} = 'GMT';

for ($clock = 2147483641; $clock < 2147483651; $clock ) {
print ctime($clock);
}

# Correct output is the following:
#
# Tue Jan 19 03:14:01 2038
# Tue Jan 19 03:14:02 2038
# Tue Jan 19 03:14:03 2038
# Tue Jan 19 03:14:04 2038
# Tue Jan 19 03:14:05 2038
# Tue Jan 19 03:14:06 2038
# Tue Jan 19 03:14:07 2038 <-- Last second in 32-bit Unix systems
# Tue Jan 19 03:14:08 2038
# Tue Jan 19 03:14:09 2038
# Tue Jan 19 03:14:10 2038

"

0 Comments:

Post a Comment

<< Home