File fix-time-local.patch of Package perl-OLE-Storage_Lite
Date: 2018-02-21
Author: Bernhard M. Wiedemann <bwiedemann suse de>
https://rt.cpan.org/Public/Bug/Display.html?id=124513
fix how code uses Time::Local to ensure no relative 2-digit dates are used
to make tests pass in 2020 and beyond
Index: OLE-Storage_Lite-0.19/lib/OLE/Storage_Lite.pm
===================================================================
--- OLE-Storage_Lite-0.19.orig/lib/OLE/Storage_Lite.pm
+++ OLE-Storage_Lite-0.19/lib/OLE/Storage_Lite.pm
@@ -1364,7 +1364,9 @@ sub LocalDate2OLE {
return "\x00" x 8 unless $localtime;
# Convert from localtime (actually gmtime) to seconds.
- my $time = timegm( @{$localtime} );
+ my @localtimecopy = @{$localtime};
+ $localtimecopy[5] += 1900 unless $localtimecopy[5] > 99;
+ my $time = timegm( @localtimecopy );
# Add the number of seconds between the 1601 and 1970 epochs.
$time += 11644473600;