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

Revered Monks,
I am forming a time stamp with DATE::Format module. My intension is to get a time stamp which is exactly one hour less than the current timestamp. Is there a way by which i can do something like
$time -1;
where i get the time less than 1 hour. Any suggestion would be highly appreciated
-Prasanna.K

Replies are listed 'Best First'.
Re: question on Time module
by ikegami (Patriarch) on Jun 03, 2008 at 22:23 UTC
    my $time = time - 60*60;

    May produce odd (but correct) results near a DST time change.

Re: question on Time module
by almut (Canon) on Jun 03, 2008 at 22:23 UTC

    time() - 60*60  will give you "now less than one hour" in seconds since the Epoch (i.e. unixtime), which you can then pass to the respective formatting functions...

Re: question on Time module
by igelkott (Priest) on Jun 03, 2008 at 22:20 UTC

    Make use of another date module such as Date::Manip, Date::Calc or Time::Piece (core module in 5.10).

    These may also be able to replace what Date::Format is doing for you.