-2

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.

laurent
  • 88,262
  • 77
  • 290
  • 428
Peon
  • 7,902
  • 7
  • 59
  • 100

2 Answers2

3

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)
Pim Broens
  • 702
  • 1
  • 5
  • 16
1

This is still a valid ISO date. The 'Z' at the end of 2016-09-30T09:18:29.044Z simply means that it's a UTC date.

laurent
  • 88,262
  • 77
  • 290
  • 428
  • That is true, but who does it have seconds as `.004` and not `:004` ? – Peon Sep 30 '16 at 12:19
  • It doesn't `2016-09-30T09:18:29.044Z` has a :29 seconds. The .044 in this case is the fraction of a second, or microsecond if you will for this stamp. – Pim Broens Sep 30 '16 at 12:43