in reply to Find 30 days from today's date

Try Date::Manip.

use warnings; use strict; use Date::Manip::Date 6.30; my $today = Date::Manip::Date->new("today"); print $today->printf("Today is: %Y-%m-%d\n"); my $month_ago = $today->calc($today->new_delta("-1 months")); print $month_ago->printf("A month ago from today is: %Y-%m-%d\n"); my $thirty_ago = $today->calc($today->new_delta("-30 days")); print $thirty_ago->printf("Thirty days ago from today is: %Y-%m-%d\n") +; __END__

The output today is this:

Today is: 2014-04-18 A month ago from today is: 2014-03-18 Thirty days ago from today is: 2014-03-19
There's a difference between the two because March had 31 days.