What is the most efficient way to calculate the date (year, month, date) 50 days ago from today?
I can get the current date and convert it to second, and subtract 50*86400, then convert the seconds back
to date.
Any quicker and easier ways? existing functions to use?
Date calculation: what is the date 50 days ago from today?
Moderator: General Moderators
Re: Date calculation: what is the date 50 days ago from today?
Code: Select all
list($month, $day, $year) = explode('/', date('m/d/Y', strtotime("-50 Days")));
echo "$month/$day/$year";