in reply to Question regarding Time::Piece and timezones
The behavior also appears to occur if I change my $t = localtime; to my $t = gmtime; as well, where the timezone is then 'UTC'.
That is very interesting. If I run your original code as posted (with Time::Piece 1.3401) with the TZ environment variable unset, it runs to completion and I see this output:
Time is: Thu, 14 Jan 2021 09:48:00 GMT Time is: Thu, 14 Jan 2021 09:48:00 UTC
Note that the textual representation of the timezone differs in the two lines of output.
If I subsequently re-run it with TZ set to apparently anything other than "GMT", then it bombs out. Even if I set it to "UTC" it will bomb out. This looks like a bug in Time::Piece .
Time is: Thu, 14 Jan 2021 10:03:32 UTC Error parsing time at /usr/local/lib64/perl5/Time/Piece.pm line 598. at tp.pl line 11. main::__ANON__("Error parsing time at /usr/local/lib64/perl5/Time/ +Piece.pm li"...) called at /usr/local/lib64/perl5/Time/Piece.pm line +598 Time::Piece::strptime("Time::Piece", "Thu, 14 Jan 2021 10:03:32 UT +C", "%a, %d %b %Y %T %Z") called at tp.pl line 23
🦛
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Question regarding Time::Piece and timezones
by atcroft (Abbot) on Jan 15, 2021 at 01:50 UTC | |
Re^2: Question regarding Time::Piece and timezones
by Marshall (Canon) on Jan 23, 2021 at 02:21 UTC | |
by syphilis (Archbishop) on Jan 23, 2021 at 10:04 UTC | |
by atcroft (Abbot) on Jan 23, 2021 at 22:42 UTC |