omegaweaponZ has asked for the wisdom of the Perl Monks concerning the following question:
Trying to convert an epoch time like 1370376667000 to a datetime format, such as 2013-06-04 16:00:00. Trying conventional parsers and even one designed for Epoch, but coming up with issues....
Doing this comes up with a bad format, such as 45395-07-05 01:16:40, it should be 2013-06-04 16:11:07. Any thoughts? Please note, I don't care about using the DateTime::Format::Epoch::Unix package, but I would like to know how this can be done in just DateTime or basically the most simple methodmy $epoch = "1370376667000"; my $formatter = DateTime::Format::Epoch::Unix->new(); my $newtime = $formatter->parse_datetime("$epoch");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Epoch Converter
by BrowserUk (Patriarch) on Jun 04, 2013 at 21:09 UTC | |
|
Re: Epoch Converter
by NetWallah (Canon) on Jun 04, 2013 at 23:33 UTC |