in reply to SOLVED: DateTime's epoch method returns UTC value?
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 |