Skip to content

ISO 8601

Type Registry

ISO 8601

datetime.timestamp.iso_8601

Standard international datetime format with UTC indicator. The most widely used machine-readable datetime format.

Domain datetimetimestamp
Casts to TIMESTAMP
Scope Universal

Try it

CLI
$ finetype infer -i "2024-01-15T10:30:00Z"
→ datetime.timestamp.iso_8601

DuckDB

Detect
SELECT finetype('2024-01-15T10:30:00Z');
-- → 'datetime.timestamp.iso_8601'
Cast expression
strptime({col}, '%Y-%m-%dT%H:%M:%SZ')
Format: %Y-%m-%dT%H:%M:%SZ
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';

JSON Schema

finetype schema datetime.timestamp.iso_8601
{
  "$id": "https://noon.sh/schemas/datetime.timestamp.iso_8601",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Standard international datetime format with UTC indicator. The most widely used machine-readable datetime format.",
  "examples": [
    "2024-01-15T10: 30: 00Z",
    "2019-12-31T23: 59: 59Z",
    "2023-06-01T00: 00: 00Z"
  ],
  "maxLength": 20,
  "minLength": 20,
  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$",
  "title": "ISO 8601",
  "type": "string"
}

Examples

2024-01-15T10:30:00Z2019-12-31T23:59:59Z2023-06-01T00:00:00Z

Also known as

big_endian

Types in datetime