in reply to Re: Time::Piece reversibility
in thread Time::Piece reversibility

I did try _04 too. I hadn't noticed the TZ difference, but it's still showing as 5pm rather than 10am:

strftime: Mon, 19 Jun 2017 17:07:42 PDT

And no, I forgot about the month being zero based for the test. Thx.

Replies are listed 'Best First'.
Re^3: Time::Piece reversibility
by hippo (Archbishop) on Jun 17, 2017 at 23:26 UTC
    it's still showing as 5pm rather than 10am:

    Yes, that's definitely the problem. It seems that localtime is changing the epoch as well as setting the offset so you're always getting back to the same displayed hour when you apply both (and gmtime is of course doing neither). Good spot.