#!/usr/bin/perl ###Load Modules use warnings; use strict; use Date::Manip; use Time::HiRes; use CGI; my $cgi = new CGI; ###Set $err so you can specify a mode for &DateCalc my $err; ###Set Dates to Calculate for, then Find Difference my $curtime = getime(); my $date1 = &ParseDate($curtime); my $date2 = &ParseDate("03:14:06 Jan 19 2038"); my $delta = &DateCalc($date1,$date2,\$err,1); ###Populate Data hash my %data; @data{qw/years months weeks days hours minutes seconds/} = $delta =~ /(\d+)/g; ###Begin HTML Output, yes this is bad, but it's quick-n-dirty :) print $cgi->header(); print< Countdown to the Death of 32bit time_t

Countdown to the Death of 32bit time_t (Tue Jan 19 3:14:06 2038 GMT)


$data{years} Year(s)

$data{months} Months(s)

$data{weeks} Weeks(s)

$data{days} Day(s)

$data{hours} Hour(s)

$data{minutes} Minutes(s)

$data{seconds} Second(s)


END my $now = &getime(); print< END ###Get current time (GMT) sub getime() { my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(); ###Correct for 'zero math' $year += 1900; $mon += 1; my $time = "$hour:$min:$sec $mon\/$mday\/$year"; return $time; }