Input time format:
2016-05-03 01:38:54
Ouput time format:
2016-05-03T01:38:54.003Z
Here what is .003
, is it millisecond or microsecond?
And in PHP the microsecond format is 'u'
, but when I am trying to use this using the following code snippet, I am getting 6 digits after the decimal point:
<?php
date_default_timezone_set("Asia/Kolkata");
echo date('Y-m-d\TH:i:s.u\Z', strtotime("2016-05-03 01:38:54"));
I am getting the output as:
2016-05-03T01:38:54.000000Z
But in this output after the decimal point it is showing 6 digit, which I want to change it to 3 digit. How can I do that?
So how should I get the output format?