in reply to Getting previous dates from the current date
However, a small "proof of concept" won't hurt anyone:
Warning: The code presented doesn't consider daylight saving times changes.my $date = '2005-03-29'; my $d = ...; # anyone knows of a direct way to do this? for (1, 7, 14) { my $d = $d - $_ * 60 * 60 * 24; printf ("$_ days ago: %04d-%02d-%02d",(localtime($d))[5,4,3]); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Getting previous dates from the current date
by Smylers (Pilgrim) on Mar 29, 2005 at 17:27 UTC | |
by cog (Parson) on Mar 29, 2005 at 17:53 UTC |