ISO 8601 with Milliseconds
datetime.timestamp.iso_8601_millisecondsISO 8601 datetime with 3-digit millisecond precision and UTC indicator. The exact output of JavaScript Date.toISOString() — arguably the most common timestamp format in JSON REST APIs worldwide.
Operations on this type: Parse a date or time
Try a value
ISO 8601 with Milliseconds's rule accepts it.
Reads it as 2024-03-04 05:06:07.123
Use it
finetype infer -i '2024-01-15T14:30:00.123Z' --mode column
# → datetime.timestamp.iso_8601_millisecondsSELECT ft_infer('2024-01-15T14:30:00.123Z');
-- → 'datetime.timestamp.iso_8601_milliseconds'strptime({col}, '%Y-%m-%dT%H:%M:%S.%gZ')
-- Format: %Y-%m-%dT%H:%M:%S.%gZHow finetype reads the samples
DuckDB 1.5.5 · finetype 0.6.66
| Value | As TIMESTAMP |
|---|---|
| 2024-01-15T14:30:00.123Z | 2024-01-15 14:30:00.123 |
| 2019-12-31T23:59:59.999Z | 2019-12-31 23:59:59.999 |
| 2023-06-01T00:00:00.000Z | 2023-06-01 00:00:00 |
- %Y
- four-digit year
- %m
- month, two digits
- %d
- day of month, two digits
- %H
- hour, 24-hour clock
- %M
- minutes
- %S
- seconds
- %g
- milliseconds
Pattern
^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$| Value | Length | Shape |
|---|---|---|
| 2024-01-15T14:30:00.123Z | 24 | matches |
| 2019-12-31T23:59:59.999Z | 24 | matches |
| 2023-06-01T00:00:00.000Z | 24 | matches |
| 2024-01-15T14:30:00.123 | 23 | rejected: one character short |
Background
Origin
ECMAScript defines a string interchange format for date-times, adapted from the ISO 8601 calendar date extended format and written YYYY-MM-DDTHH:mm:ss.sssZ.[1] In the ECMAScript format, sss is the number of complete milliseconds since the start of the second, written as three decimal digits.[1] ECMAScript's Date.prototype.toISOString returns a date in the Date Time String Format on the UTC time scale, including all format elements and the UTC offset representation "Z".[1]
The first edition of the ISO 8601 standard was published as ISO 8601:1988 in June 1988.[2] ISO 8601 allows a decimal fraction on the lowest-order time element, separated from it by either a comma or a dot.[2] In ISO 8601, a time in UTC is marked by adding a Z directly after the time, without a space.[2] RFC 3339, titled Date and Time on the Internet: Timestamps, was written by G. Klyne and C. Newman and is dated July 2002.[3] RFC 3339 defines a profile of ISO 8601 for use in Internet protocols.[3] RFC 3339 defines the suffix Z as denoting a UTC offset of 00:00, often spoken "Zulu" from the ICAO phonetic alphabet.[3]
Use
MongoDB's Extended JSON documentation gives 2019-08-11T17:54:14.692Z as an example of a relaxed-mode date.[4] MongoDB Extended JSON v2 says fractional seconds should be omitted when they are zero.[4]
RFC 3339 notes that timestamps in the same time zone, written the same way and with the same number of fractional digits, sort as strings into time order.[3] A pattern check confirms the shape only; leave it to a real date parser to reject impossible values such as a thirteenth month. (Meridian's view)
Where you'll meet it
The npm registry's package document for left-pad records the package's creation time as 2014-03-14T09:09:20.762Z.[5]
Sources
- [1]ECMAScript® 2027 Language Specificationstandard
- [2]ISO 8601secondary source
- [3]Date and Time on the Internet: Timestampsstandard
- [4]MongoDB Extended JSON (v2)documentation
- [5]left-paddataset
How it's detected
Highest-impact single addition — covers the entire JavaScript ecosystem. Distinct from iso_8601 by mandatory 3-digit fractional seconds.
Schema
https://meridian.online/schemas/datetime.timestamp.iso_8601_milliseconds · Frictionless type datetime · any
finetype taxonomy datetime.timestamp.iso_8601_milliseconds -o json-schema