We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This code:
use Time::Piece; use Time::Seconds; my $t = localtime(1583731856); print "Current date: $t with hour offset: " . $t->tzoffset / 60 / 60 . "\n"; my $t2 = $t - ONE_DAY; print "Minus 24 hours is: $t2 with hour offset: " . $t2->tzoffset / 60 / 60 . "\n";
Outputs this:
Current date: Mon Mar 9 00:30:56 2020 with hour offset: -5 Minus 24 hours is: Sat Mar 7 23:30:56 2020 with hour offset: -6
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.
The text was updated successfully, but these errors were encountered:
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.
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
Sorry, something went wrong.
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: