in reply to Can Date::Manip parse a unix timestamp ?
For unix timestamps, just prepend "epoch ". This is well documented.
$ perl -wE 'use Date::Manip; say UnixDate("epoch 1264108407", "%O\n")' + 2010-01-21T22:13:27
If you have Date::Manip 6, you can also parse that format with Date::Manip directly, though not with the default parsing rules, you have to give the format explicitly.
$ perl -wE 'use Date::Manip 6.0; my $d = Date::Manip::Date->new; $d->p +arse_format("%a %b %d %T %Y %z", "Thu Jan 21 17:13:27 2010 -0400"); s +ay $d->printf("%O");' 2010-01-21T17:13:27
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can Date::Manip parse a unix timestamp?
by SBECK (Chaplain) on May 05, 2010 at 15:31 UTC | |
by ambrus (Abbot) on Oct 28, 2015 at 11:09 UTC |