Good day! I have a code that needs to add 2 dates from a table and display the total(in days and weeks) on the same php table as well. How can I execute it? i have this code but it doesnt seem to do anything with the dates. my sql name of the column dates are ‘date_started’ and ‘date_completed’
`$datetime1 = date_create($_GET['dateStarted']);
$datetime2 = date_create($_GET[‘dateCompleted’]);
$interval = date_diff($datetime1, $datetime2);
`
then this is the echo that i put in the table:
{$interval->format(‘%R%a days’)}`