|
Posted by brian d foy on June 1, 2008, 5:24 am
Please log in for more thread options
> The core module Time::Local + localtime() are sufficient to answer the
> FAQ question safely.
>
> use Time::Local;
> my $today = timelocal 0, 0, 12, ( localtime )[3..5];
> my ($d, $m, $y) = ( localtime $today-86400 )[3..5];
> printf "Yesterday: %d-%02d-%02d\n", $y+1900, $m+1, $d;
Added to the FAQ. Thanks,
|