in reply to Getting previous dates from the current date
Pretty easy. There are 86400 seconds in a day.
or$time = time() - (86400 * $numOfDays); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($tim +e); $mon++; $year = $year + 1900;
$time = time() - (86400 * $numOfDays); $realTime = localtime($time); print scalar $realTime;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Getting previous dates from the current date
by Smylers (Pilgrim) on Mar 29, 2005 at 17:29 UTC | |
Re^2: Getting previous dates from the current date
by FitTrend (Pilgrim) on Mar 29, 2005 at 18:26 UTC | |
by Smylers (Pilgrim) on Mar 30, 2005 at 08:42 UTC |
In Section
Seekers of Perl Wisdom