in reply to Get previous date

Another way to get yesterday's date:
#!/usr/bin/perl use warnings; use strict; use Time::Local 'timelocal_nocheck'; sub days_before_now { my @date = localtime; return timelocal_nocheck(@date[0..2],$date[3]-$_[0], @date[4,5]); } print scalar( localtime days_before_now(1)), "\n";
days_before_now(-1) will return the tomorrow's date ;)