I'm trying to figure out how to get the date for 'yesterday'. I need it in the same format as this:
my ($sec,$min,$hour,$day,$month,$year) = localtime();
$month++; # Add 1 to the month
$year+=1900; # Add 1900 to the year
$day=sprintf("%02d",$day); # Pad the day with a 0
$month=sprintf("%02d",$month); # Pad the month with a 0
my $today = "$month$day$year";
I'm banging my head on a wall over this one. Sure, I could subtract 1 from $day, but what if today's date is 01/01/2003 or 03/01/2002. What about leap year, 31 day months vs 30 day months vs 28 day months? I just can't think of any way to do it and get it in the same format.
my ($sec,$min,$hour,$day,$month,$year) = localtime();
$month++; # Add 1 to the month
$year+=1900; # Add 1900 to the year
$day=sprintf("%02d",$day); # Pad the day with a 0
$month=sprintf("%02d",$month); # Pad the month with a 0
my $today = "$month$day$year";
I'm banging my head on a wall over this one. Sure, I could subtract 1 from $day, but what if today's date is 01/01/2003 or 03/01/2002. What about leap year, 31 day months vs 30 day months vs 28 day months? I just can't think of any way to do it and get it in the same format.