Wednesday, October 3, 2007

Tip for the day: YET ANOTHER COUNTDOWN

The unix time() value will rollover to 10 digits for the first time in modern computer history starting Saturday Sept 8th,2001. The timestamp will be 10 digits long, and not 9.

Here's a short Perl script to compute the time left:

#!/usr/bin/perl -w
use strict;

my $now=time();
my $target='1000000000';
my
($sec,$min,$hrs,$dom,$mon,$year,$wday,$yday,$isdst)=localtime($target
- $now);
my $now_string=localtime(time());
my $target_string=localtime($target);
my $message=qq{today is $now_string\n$mon months $dom days $hrs
hours $min minutes $sec seconds left till U1e9
($target_string)\n};
print $message;

No comments: