Meridianmeridian

ISO 8601 with Milliseconds

datetime.timestamp.iso_8601_milliseconds

ISO 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.

Domain
datetime
Category
timestamp
Casts to
TIMESTAMP
Scope
Universal

Try it

CLI
$ finetype infer -i "2024-01-15T14:30:00.123Z"
→ datetime.timestamp.iso_8601_milliseconds

DuckDB

Detect
SELECT finetype('2024-01-15T14:30:00.123Z');
-- → 'datetime.timestamp.iso_8601_milliseconds'
Cast expression
strptime({col}, '%Y-%m-%dT%H:%M:%S.%gZ')
-- Format: %Y-%m-%dT%H:%M:%S.%gZ
Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(finetype_cast(my_column) AS TIMESTAMP) AS clean_value
FROM my_table
WHERE finetype(my_column) = 'datetime.timestamp.iso_8601_milliseconds';

JSON Schema

finetype schema datetime.timestamp.iso_8601_milliseconds
{
  "$id": "https://meridian.online/schemas/datetime.timestamp.iso_8601_milliseconds",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "ISO 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.",
  "examples": [
    "2024-01-15T14: 30: 00.123Z",
    "2019-12-31T23: 59: 59.999Z",
    "2023-06-01T00: 00: 00.000Z"
  ],
  "maxLength": 24,
  "minLength": 24,
  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
  "title": "ISO 8601 with Milliseconds",
  "type": "string",
  "x-finetype-broad-type": "TIMESTAMP",
  "x-finetype-format-string": "%Y-%m-%dT%H:%M:%S.%gZ",
  "x-finetype-transform": "strptime({col}, '%Y-%m-%dT%H:%M:%S.%gZ')"
}

Examples

2024-01-15T14:30:00.123Z2019-12-31T23:59:59.999Z2023-06-01T00:00:00.000Z

Aliases

js_isoiso_millis