in reply to Re^3: Convert GMT timestamp to EST/EDT (Time::Local + Time::Piece)
in thread Convert GMT timestamp to EST/EDT

The title of the thread is "Convert GMT timestamp to EST/EDT." :P

  • Comment on Re^4: Convert GMT timestamp to EST/EDT (Time::Local + Time::Piece)

Replies are listed 'Best First'.
Re^5: Convert GMT timestamp to EST/EDT (Time::Local + Time::Piece)
by ikegami (Patriarch) on Jul 28, 2015 at 20:03 UTC

    Right, but the code posted anonymously converts to local time instead. That may not be correct.

    On second thought, he surely meant for $ENV{TZ} = "US/Eastern"; to remain used, in which case his code works. I didn't quite understand his point (that you can make things more complicated by replacing sprintf with Time::Piece) when I wrote my comment. If you want to use strftime instead of sprintf, you might as well grab it directly from POSIX instead of involving (rather horrible) Time::Piece.