use Time::Piece; use Time::Seconds; my $now = localtime; # Now a Time::Piece object my $then = $now - (14 * ONE_DAY); print $then->ymd; # or various other output functions