in reply to How to subtract date by 1 day
Subtract 24*60*60 seconds from the unix time before using localtime to split into units.
I recommend POSIX::strftime for converting that to a string.
prints this time yesterday in your format.use POSIX 'strftime'; print strftime "%Y_%m_%d_%H_%M_%S/n", localtime() - 24 * 60 * 60;
After Compline,
Zaxo
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to subtract date by 1 day
by ikegami (Patriarch) on Dec 13, 2007 at 15:08 UTC |
In Section
Seekers of Perl Wisdom