Skip Menu |
 

This queue is for tickets about the OLE-Storage_Lite CPAN distribution.

Report information
The Basics
Id: 124513
Status: new
Priority: 0/
Queue: OLE-Storage_Lite

People
Owner: Nobody in particular
Requestors: bitcardbmw [...] lsmod.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.19
Fixed in: (no value)



Subject: dates misinterpreted after 2020
similar to https://rt.cpan.org/Public/Bug/Display.html?id=124508 after 2020-01-01 tests were failing because year 70 was now interpreted as 2070 # Failed test ' LocalDate2OLE: Thu Jan 1 00:00:00 1970 # at t/01_date_conversion.t line 40. # got: '0040352757CF0D02' # expected: '00803ED5DEB19D01' This patch fixed it for me, but it may change how an input of year=18 is parsed (1918 instead of 2018) 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;


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.