Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

How would you calculate an hour into the future using a mysql timestamp as a reference? Or is there a better way to record the time to make calculate 1 hour in advance a simpler task?

Replies are listed 'Best First'.
Re: an hour from now in timestamp
by McDarren (Abbot) on Feb 07, 2006 at 23:23 UTC
    Seeing that you're using MySQL, you could simply do:
    select now() + interval 1 hour;
    For a Perl-ish solution, you probably want to look at Date::Calc

    Cheers,
    Darren :)

      For just one hour, Date::Calc is probably overkill. Presuming you have it as epoch seconds just add 3600 and be done with it. However if this is just an example and your needs are more generic then yes look at that or something like DateTime.