You can check if the current date and time came after a specified date and time by using this format.
YYYYMMDDHHMMSS
Right now, it would be 20020220194516.
my $comparetodate = 20020220194516; # This would probably be taken fro
+m a database or something.
my ($sec, $min, $hour, $mday, $mon, $year) = localtime;
my $date = sprintf "%04d%02d%02d%02d%02d%02d",$year+1900,$mon+1,$mday,
+$hour,$min,$sec;
print "Content-type: text/html\n\n";
if ($date > $comparetodate) {
print "Right now is after the archived date.";
} else {
print "Right now is before the archived date.";
}
The hour must be in 24-hour format. You don't have to use the hour, minute, and second if you just want to compare the date and not the time.
-joshua