in reply to SOLVED: DateTime's epoch method returns UTC value?

There's no such thing as a non-UTC epoch number. At one moment in time, the epoch will be identical all around the world, always. (give or take the way different systems handle leap seconds)

For normal date handling, you start with an epoch, create a DateTime from that epoch, then set_time_zone to get a localized rendering of the time. DateTime objects start on the "floating" time zone, so sometimes you need to first set_time_zone("UTC") then set_time_zone($TZ).

BTW, the DateTime module respects the $ENV{TZ} rather than the symlink in your filesystem, so make sure that is set correctly wherever the perl script runs.

Replies are listed 'Best First'.
Re^2: DateTime's epoch method returns UTC value?
by talexb (Chancellor) on Jun 03, 2024 at 21:29 UTC

    Thanks -- it looks like I've sorted this out. The original script ran without any timezone specification, so it was 'floating' .. and that worked fine. My mistake was trying to set a timezone at the new installation.

    Alex / talexb / Toronto

    Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.