From 0a27cdf136ea8f062fdb319ee99f9d76986522d5 Mon Sep 17 00:00:00 2001 From: djk Date: Sun, 21 Mar 1999 21:37:34 +0000 Subject: [PATCH] added extra validation to the year. need my own routine. --- perl/DXUtil.pm | 2 ++ 1 file changed, 2 insertions(+) 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"; -- 2.43.0