-
-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
use DateTime;
my $dt = DateTime->new( "year" => 2022, "month" => 10, "day" => 30, "hour" => 1, "time_zone" => "Europe/Dublin" );
say $dt->is_dst;
$dt->add( "hours" => 1 );
say $dt->is_dst;
$dt->truncate( "to" => "hour" );
say $dt->is_dst;Output:
0
1
0
So truncate rewinded time back to hour before DST gap.
- From relative time perspective it looks incorrect - there is nothing to truncate in
2022-10-30T01:00:00. - From absolute time perspective it looks correct - there are extra 3600 seconds that could be chopped to reach
2022-10-30T01:00:00.
If this is correct behavior i think it should be mentioned in truncate and set methods.
Metadata
Metadata
Assignees
Labels
No labels