From: djk Date: Sun, 21 Mar 1999 21:37:34 +0000 (+0000) Subject: added extra validation to the year. need my own routine. X-Git-Tag: R_1_25~6 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=0a27cdf136ea8f062fdb319ee99f9d76986522d5;p=spider.git added extra validation to the year. need my own routine. --- diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index 6c3ff30a..fe82721e 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -64,8 +64,10 @@ sub cltounix { my $date = shift; my $time = shift; + my ($thisyear) = (gmtime)[5] + 1900; return 0 unless $date =~ /^\s*(\d+)-(\w\w\w)-([12][90]\d\d)$/; + return 0 unless abs($thisyear-$3) <= 1; $date = "$1 $2 $3"; return 0 unless $time =~ /^([012]\d)([012345]\d)Z$/; $time = "$1:$2 +0000";