Convert current server time to ISO 8601
I must convert the server current time to this format:
I think this is an ISO 8601 (even if I don't understand what are the final numbers, supposedly microseconds).
How can I do? Any help is welcome
The final numbers are the microseconds. It is easy to output a given DateTime object $d in this format:
It is not so easy, to get the current timestamp including microseconds, because constructing it with now only gets whole seconds. You could go this way and append the microseconds manually:
echo date('Y-m-d\TH:i:s') . substr((string) microtime(), 1, 7); // 2016-03-23T14:55:25.535678