I want to calculate the difference between two dates
$startDate = date_create(date('Y-m-d H:i:s'));
$targetDate = date_create('2018-01-30 11:00:00');
$result = strtotime($targetDate) - strtotime($startDate);
$result = (int) $result;
echo $result;
but returned
Warning: strtotime() expects parameter 1 to be string, object given in /home/info.php on line 50
how can I solve this problem?