I am calling an API. The format for timestamp returned is as follows:
"Date":"2018-05-06T23:42:03+01:00"
How do I separate date from time?
So far, what I have is:
$ts = "2018-05-06T23:42:03+01:00";
$date = substr($ts, 0, strpos($ts, "T"));
$date = str_replace($date,"T","");
While this would work, is there a better way of doing this?