]> dxcluster.org Git - spider.git/commitdiff
added extra validation to the year. need my own routine.
authordjk <djk>
Sun, 21 Mar 1999 21:37:34 +0000 (21:37 +0000)
committerdjk <djk>
Sun, 21 Mar 1999 21:37:34 +0000 (21:37 +0000)
perl/DXUtil.pm

index 6c3ff30af271f7d31a3657c82dd01500c4cf9446..fe82721e16c04e5bdf0095eb56f347b5a3e6609d 100644 (file)
@@ -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";