Open smith153 opened 4 years ago
I can confirm this issue
use Time::Piece;
my $t1 = localtime(1667080800);
my $t2 = $t1 + Time::Seconds::ONE_DAY;
print "T1: $t1\nT2: $t2\n";
Output:
T1: Sun Oct 30 00:00:00 2022
T2: Sun Oct 30 23:00:00 2022
T2 should be Mon Oct 31 00:00:00 2022
.
On the Sun Oct 30 at the 03:00 AM we have moved the clock back of one hour so the day has been 25 hours. How can be fix this issue?
Thank you in advance, Emanuele
This code:
Outputs this:
The correct date should be "Sun Mar 8 00:30:56 2020". The problem is there are only 23 hours in that day and we are subtracting 24.