I am getting the time with DialogFlow and the time format is something like "2020-08-28T14:00:00+02:00". I need to get the substraction between a time stored in the data base (format: "H:i:s" -> "12:01:00");
$time = $res2["Results"][0]["time"]; // the time of data base
$time_converted = DateTime::createFromFormat("H:i:s", $time);
$time_end_converted = strtotime("yyyy-MM-dd'T'HH:ii:ss", $params->time_end); //time from dialogflow
//var_dump($time_end_converted);
$interval = abs($time - $time_end_converted);
$time_end = date('H:i:s', $interval);
//var_dump($time_end);
But the difference between both times are not correct. I think the time_end_converted has not got a correct format. How can i convert the time from DialogFlow to a time with the format "H:i:s"??
Thanks!