I have two date variables:
$dnow = "2016-12-1";
$dafter = "2016-12-11";
I want to calculate the difference between these two dates, which are in a string format, and how can I calculate? I used
date_diff($object, $object2)
but it expects two date objects, and I have dates in String format , After using, date_diffI get the following error
Message: an object of the DateInterval class cannot be converted to a string.
source
share