Dainis Abols Dainis Abols - 2 months ago 11
PHP Question

What ISO date format is this?

I could not locate this format, can you tell me please what ISO format is this?

2016-09-30T09:18:29.044Z


I need to recreate this in PHP.

It is similar to ISO-8601 (
date('c')
) but the ending is different.

Answer

It still is ISO 8601, but there are different versions for this available. Check the W3C about this. There are 6 different versions:

Year:
  YYYY (eg 1997)
Year and month:
  YYYY-MM (eg 1997-07)
Complete date:
  YYYY-MM-DD (eg 1997-07-16)
Complete date plus hours and minutes:
  YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)
Complete date plus hours, minutes and seconds:
  YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)
Complete date plus hours, minutes, seconds and a decimal fraction of a second
  YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)
Comments