LeeC79 has asked for the wisdom of the Perl Monks concerning the following question:
What I would like to do though is get the previous day. Any help is appreciated, thanks.my $sec; my $min; my $hour; my $mday; my $mon; my $year; my $wday; my $yday; my $isdist; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdist) = localtime(tim +e); $year = $year + 1900; $mon = $mon + 1; if (length $mday == 1){ $mday = "0".$mday; } if (length $mon == 1){ $mon = "0".$mon; } if (length $hour == 1){ $hour = "0".$hour; } if (length $sec == 1){ $sec = "0".$sec; } my $now_string = $year.$mon.$mday;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: localtime()
by merlyn (Sage) on Jul 16, 2004 at 20:09 UTC | |
by Belgarion (Chaplain) on Jul 16, 2004 at 20:24 UTC | |
by Nkuvu (Priest) on Jul 16, 2004 at 20:27 UTC | |
|
Re: localtime()
by blokhead (Monsignor) on Jul 16, 2004 at 20:17 UTC | |
by LeeC79 (Acolyte) on Jul 19, 2004 at 12:59 UTC | |
|
Re: localtime()
by Mercio (Scribe) on Jul 17, 2004 at 00:29 UTC | |
by davido (Cardinal) on Jul 17, 2004 at 08:09 UTC |