This format is defined by ISO 8601 standard. According to this standard, the capital letter "T" is used to separate date and time fields. So we have "year-month-day," followed by the letter "T," followed by "hour:minute:second".
The seconds can have the fractions (using the point as the decimal separator), which in their case are 966 milliseconds.
"Z" indicates this date and time is in UTC.
In PHP you can use a DateTime
, that already recognizes this format by default:
$d = new DateTime('2020-01-08T16:28:59.966Z');
// mostrar a data em outro formato
echo $d->format('d/m/Y H:i:s.u e'); // 08/01/2020 16:28:59.966000 Z
As to the your comment on the format be "yyyy-MM-dd’T'HH:mm:ss.SSSX", probably "X" refers to the offset, which is the difference with UTC. In its example, the "Z" refers to UTC itself, which is the same as saying that the offset is zero. You can see more information about offsets in wiki of the tag Timezone.
The date format is in the American standard, where
ANO/MÊS/DIA
oryyyy/mm/dd
. TheT
means TEAM (Time). the.966
would be the milliseconds– Jakson Fischer
It worked Jakson. Thank you!
– Caue Silvestre
Come on, you’re welcome, my friend :)
– Jakson Fischer
Jakson, the API returned: yyyy-MM-dd’T'HH:mm:ss.SSSX, this SSSX is the milliseconds?
– Caue Silvestre
Can you give me the documentation link so I can take a look?
– Jakson Fischer
@Jaksonfischer Actually the American format is "month/day/year". This question format is defined by ISO 8601 standard, and is "year-month-day" (hyphenated instead of bars).
– hkotsubo
@hkotsubo, in fact, confused me at the time of information
– Jakson Fischer