in reply to Re^2: Yesterday's date
in thread Yesterday's date
If you want Time::Piece to respect time zones, you need to initialize the object from localtime, not from the class itself:
$ TZ=Europe/London perl -MTime::Piece -wE ' for my $source ("Time::Piece", scalar localtime()) { my $t = $source->strptime("2023/03/27", "%Y/%m/%d"); say $t - 86400; }' Sun Mar 26 00:00:00 2023 Sat Mar 25 23:00:00 2023
|
|---|