I need some help parsing a date in PHP to a date object. I thought this was 8601 format, but $date = DateTime::createFromFormat(DateTime::ISO8601, "2018-11-14T01:11:36.059Z") is not working.
Date Format is: 2018-11-14T01:11:36.059Z
The date receiving from server is not fixed in specific format then how can I detect which format am getting so that I can convert it into specific date format and display in the app according to the functionality.
Here are some examples that am receiving are:
I have the following string with the 'T' seperator - how do change the $format var correctly to take into account the 'T' within the $datestring?
$datestring = '2018-12-30T11:30:00';
$format = 'Y-m-dG:i:s';
$date = DateTime::createFromFormat($format, $datestring);
var_dump($date); // currently...