in reply to Time::Piece and Timzone?
Your second option works fine for me (using Time::Piece 1.31_04):
$ perl -MTime::Piece my $date_string = "Jun 03 19:49:27 2018 +0200"; my $fmt = '%b %d %H:%M:%S %Y %z'; my $time=Time::Piece->strptime( $date_string, $fmt ); print $time->strftime() ."\n"; Sun, 03 Jun 2018 17:49:27 UTC
So I guess the strptime() implementation in your O/S differs from mine. Which O/S are you using?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Time::Piece and Timzone?
by suba (Acolyte) on Jun 05, 2018 at 14:30 UTC | |
|
Re^2: Time::Piece and Timzone?
by ikegami (Patriarch) on Jun 06, 2018 at 07:36 UTC | |
by hippo (Archbishop) on Jun 06, 2018 at 08:10 UTC | |
|
Re^2: Time::Piece and Timzone?
by suba (Acolyte) on Jun 05, 2018 at 14:11 UTC | |
by Anonymous Monk on Jun 05, 2018 at 16:39 UTC |