You could use Date::Calc like this:
use strict; use warnings; use Date::Calc qw/Date_to_Text Add_Delta_Days Today/; print "Yesterday: ", Date_to_Text( Add_Delta_Days( Today(), -1 ) ), "\n";
This approach has the advantage of being very easy to read, and less prone to goofing up the math behind subtracting a day from localtime, and it should avoid daylight savings time issues.
Dave
In reply to Re: Get previous date
by davido
in thread Get previous date
by Chon-Ji
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |