Skip navigation.
Your source for Perl tips, howto's, faq and tutorials
( categories: )

Use the function 'Add_Delta_Days' from 'Date::Calc' module.

The syntax of the function is:

Add_Delta_Days($year, $month, $day, $n_days)

where $n_days is the number of days you want to add (or substract) from the date specified with $year, $month and $n_days.

The function returns the calculated date as a list with 3 elements: year, month and day.


#-- add 60 days to November 4th, 1985
use Date::Calc qw(Add_Delta_Days);
($year, $month, $day) = Add_Delta_Days(1985,11,4,60);