Skip Menu |

This queue is for tickets about the Time-Piece CPAN distribution.

Report information
The Basics
Id: 55722
Status: resolved
Priority: 0/
Queue: Time-Piece

People
Owner: Nobody in particular
Requestors: wells [...] cedarnet.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 1.19
  • 1.20
Fixed in: (no value)



Subject: gmtime vs localtime in the epoch race
It could be that I'm misunderstanding the usage and if that's the case I'll go cower in the corner or something... ----- use Time::Piece; print "GMT: ", gmtime, "\n"; print "LOC: ", localtime, "\n"; print "GMT: ", gmtime->epoch, "\n"; print "LOC: ", localtime->epoch, "\n"; ----- The epoch times are EXACTLY the same - shouldn't they be different if the local time isn't the same as GMT time? or like I stated above - I could just be very confused. Thanks.
That's just how times with epochs work. See also: my $epoch = time; print scalar(gmtime($epoch)); print scalar(localtime($epoch)); - same epoch, different output.