~beaky/wacs/trunk

« back to all changes in this revision

Viewing changes to manage/wacsdnllist

  • Committer: beaky
  • Date: 2023-05-16 15:12:46 UTC
  • Revision ID: svn-v4:4196e993-711f-0410-950c-c89e1d26c723:trunk:3021
Fixed date issues with MySQL/PostgreSQL style dates in wacsdnllist.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#
3
3
# WacsDlndList
4
4
#
5
 
#    (C) Copyright 2006,2007,2008,2009,2011,2012,2020,2021 B King
 
5
#    (C) Copyright 2006,2007,2008,2009,2011,2012,2020,2021,2023 B King
6
6
#    This file is part of WACS.
7
7
#
8
8
#    WACS is free software; you can redistribute it and/or modify
33
33
$previous="";
34
34
$modelno=0;
35
35
$modelname="";
36
 
$offset=14;
 
36
$offset=14;  # the offset defaults to 14 days
37
37
$latest=1;
38
38
$debug=conf_get_attr("debug","app_wacsdnllist");
39
39
 
124
124
                                'Nov'=>10,'Dec'=>11 );
125
125
                # use timecomps to handle differing date formats
126
126
                ( $lmday, $nmon, $lyear ) = timecomps( $argument );
127
 
                $lmon = $months{$nmon};
 
127
                $lmon = $months{ int($nmon) };  # NB: digit 5 != string "05"
 
128
                # print STDERR "wacsdnllist: lmon=".$lmon."\n";
128
129
                if( $lyear < 70 )
129
130
                {
130
131
                        $lyear += 2000;
131
132
                }
132
 
                $rawdate = sprintf( "Mon %-3.3s %2d 16:00:00 %-4.4s",
 
133
                $rawdate = sprintf( "Xxx %-3.3s %2d 16:00:00 %-4.4s",
133
134
                        $lmon, $lmday, $lyear );
134
 
                # print "regenerated string is $rawdate\n";
 
135
                # printf STDERR "wacsdnllist: regenerated string is ".
 
136
                #       $rawdate."\n";
135
137
                $whennow = timelocal( (00,00,16,$lmday,$monnames{$lmon},
136
138
                                $lyear) );
137
139
                # convert it back