go ahead... be a heretic | |
PerlMonks |
Re: change hour in timestampby LanX (Saint) |
on Jun 04, 2022 at 21:55 UTC ( [id://11144398]=note: print w/replies, xml ) | Need Help?? |
> This is not a DateTime object. DateTime says
This module does not parse dates! That means there is no constructor to which you can pass things like "March 3, 1970 12:34". Instead, take a look at the various DateTime::Format::* modules on CPAN. These parse all sorts of different date formats, and you're bound to find something that can handle your particular needs. I searched around in metacpan and found Date::Parse and the Synopsis seems to do the job well, at least for epoch
Other modules - especially the one suggested by 1nickt - might be better, I just wanted to demonstrate how to solve it by yourself.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|