Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:Update
mirror.9823
mirror-2.9.y2k-fix.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mirror-2.9.y2k-fix.patch of Package mirror.9823
--- dateconv.pl +++ dateconv.pl 2001/03/11 17:55:10 @@ -37,8 +37,8 @@ # # input date and time string from ftp "ls -l" format ("Feb 01 13:25"), -# return data and time string in Unix format "dd Mmm YY HH:MM", "such as -# "1 Feb 92 13:25" +# return data and time string in Unix format "dd Mmm YYYY HH:MM", "such as +# "1 Feb 1992 13:25" sub lstime_to_standard { local( $ls ) = @_; @@ -69,6 +69,7 @@ $month_num{ "dec" } = 11; ( $mn, $yr ) = (localtime)[ 4, 5 ]; +$yr += 1900; # input date and time string from ftp "ls -l", such as Mmm dd yyyy or @@ -125,13 +126,6 @@ $year-- if( $month > $mn ); } - # Cope with a wide range of naff dates: Andrew.Macpherson@bnr.co.uk - $year %= 100 ; - - # "timelocal.pl" loops endlessly for 37 < $year < 70: - # ian@ilm.mech.unsw.edu.au (Ian Maclaine-cross) - $year += 50 if 37 < $year && $year < 70 ; - if( $use_timelocal ){ return &'timelocal( $secs, $mins, $hours, $day, $month, $year ); } @@ -140,7 +134,7 @@ } } -# input time number, output GMT string as "dd Mmm YY HH:MM" +# input time number, output GMT string as "dd Mmm YYYY HH:MM" sub main'time_to_standard { package dateconv; @@ -149,5 +143,6 @@ local( $sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst ) = gmtime( $time ); - return sprintf( "%2d $months[ $mon + 1 ] %2d %02d:%02d", $mday, $year, $hour, $min ); + $year += 1900; + return sprintf( "%2d $months[ $mon + 1 ] %4d %02d:%02d", $mday, $year, $hour, $min ); } --- mirror.pl +++ mirror.pl 2001/03/11 17:44:52 @@ -646,6 +646,7 @@ $wday,$yday,$isdst ) = localtime( time ); $mon++; + $year += 1900; $upload_log = "$home/upload_log.$mday.$mon.$year"; } @@ -3848,12 +3849,7 @@ } local($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = @t; - if( $year < 70 ){ - $year += 2000; - } - else { - $year += 1900; - } + $year += 1900; return sprintf( "%04d/%02d/%02d-%02d:%02d:%02d", $year, $mon + 1, $mday, $hour, $min, $sec );
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor