Skip to content

ISO 8601 with Timezone Offset

Type Registry

ISO 8601 with Timezone Offset

datetime.timestamp.iso_8601_offset

ISO 8601 datetime with explicit timezone offset instead of Z. Preserves the original timezone information.

Domain datetimetimestamp
Casts to TIMESTAMPTZ
Scope Universal

Try it

CLI
$ finetype infer -i "2024-01-15T10:30:00+05:00"
→ datetime.timestamp.iso_8601_offset

DuckDB

Detect
SELECT finetype('2024-01-15T10:30:00+05:00');
-- → 'datetime.timestamp.iso_8601_offset'
Cast expression
strptime({col}, '%Y-%m-%dT%H:%M:%S%z')
Format: %Y-%m-%dT%H:%M:%S%z
Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(finetype_cast(my_column) AS TIMESTAMPTZ) AS clean_value
FROM my_table
WHERE finetype(my_column) = 'datetime.timestamp.iso_8601_offset';

JSON Schema

finetype schema datetime.timestamp.iso_8601_offset
{
  "$id": "https://noon.sh/schemas/datetime.timestamp.iso_8601_offset",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "ISO 8601 datetime with explicit timezone offset instead of Z. Preserves the original timezone information.",
  "examples": [
    "2024-01-15T10: 30: 00+05: 00",
    "2023-12-29T10: 45: 30-05: 00",
    "2024-06-15T12: 00: 00+00: 00"
  ],
  "maxLength": 25,
  "minLength": 24,
  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}[+-]\\d{1,2}:\\d{2}$",
  "title": "ISO 8601 with Timezone Offset",
  "type": "string"
}

Examples

2024-01-15T10:30:00+05:002023-12-29T10:45:30-05:002024-06-15T12:00:00+00:00

Also known as

iso_8601_with_time_zone_name

Types in datetime