I'm too lazy to go look for what a MySQL time stamp looks like so I can't directly address part one. Part 2 is probably best answered using DateTime or Date::Manip (there are many other data and time related modules on CPAN too).
True laziness is hard work
| [reply] |
As GrandFather pointed out, DateTime can handle both the formatting and calculations you want. That said, you could also use Time::Piece (which I think is part of Perl Core now) as well. It has the advantage of being somewhat "lighter-weight" compared to D::T.
It helps to remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.
| [reply] |
Use the database to calculate. They're very good at date maths. I don't know the syntax for MySQL but in Postgres it's something like SELECT NOW() + interval '7 days'; | [reply] [d/l] |