date in perl -- one day before

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time() - 24*60*60);                                                                     
my $yesterday_date = sprintf  "%.d-%.2d-%.2d", $year+1900, $mon+1, $mday;                                                                                    
                                                                                                                                                             
my ($sec1,$min1,$hour1,$mday1,$mon1,$year1,$wday1,$yday1,$isdst1) = localtime(time());                                                                       
my $todays_date = sprintf  "%.d-%.2d-%.2d", $year1+1900, $mon1+1, $mday1;            

No comments:

Other Articles

Enter your email address: