I am having problems converting a string into datetime format in order to store variable into a datetime-type field of a sql table
value of $timestamp: 2019-02-23T08:30:03.77
$datum2 = substr($timestamp,0,19);
$datum2 = str_replace('T',' ', $datum2);
echo $datum2 ."<br>";
--> 2019-02-23 08:30:03 .... echo output looks ok to me
$datum2 = date_format($datum2,'Y-m-d H:i:s');
--> error message
Warning: date_format() expects parameter 1 to be DateTimeInterface
Thank you for any hints Stefan