I want to have a date like new Date().toISOString() of javascript
The output is 2018-06-11T08:30:25.597Z
I tried with
(new \DateTime('now',new \DateTimeZone("UTC")))->format(\DateTime::ISO8601) // 2018-06-12T08:21:13+0000
$t = date('c', strtotime('2010-12-30 23:21:46')); //2010-12-30T23:21:46+01:00
$t2 = date(DATE_ISO8601, strtotime('2010-12-30 23:21:46')); //2010-12-30T23:21:46+01:00
$datetime = new \DateTime('2010-12-30 23:21:46');
$t3 = $datetime->format(\DateTime::ATOM); // 2010-12-30T23:21:46+01:00
I want to combine
Combined ISO 8601 date and time in UTC (YYYY-MM-DDTHH:MM:S+Timezone Offset|Z, i.e., 2018-04-18T11:02:05.261Z)
In Javascript I can have this format with
new Date().toISOString() //2018-06-12T08:24:49.321Z