Hi,
Given a date, is there a function for adding/subtracting a variable number of days which will return the new date? The date_add and date_sub functions don't return a date and these are only experimental functions.
Thanks.
Adding/subtracting of dates
Moderator: General Moderators
Re: Adding/subtracting of dates
strtotime()
example:
though iirc, date_add and date_sub are mysql functions so you could do say "now() + interval 3 day"
example:
Code: Select all
echo date("F d Y g:i:sa", strtotime("12 Jan 2008 1:00:00pm + 3 days"));