Skip to content

Support RFC9557 timestamp with time zone (IXDTF, extends RFC3339) #2551

@chrisveness

Description

@chrisveness

What version of Ajv you are you using?

8.17.1

What problem do you want to solve?

Validate IXDTF timestamps which include time zone, per RFC9557.

What do you think is the correct solution to problem?

RFC9557 extends RFC3339 with optional time zone information; it would be useful for ajv to be able to parse IXDTF timestamps which include a suffixed time zone.

Will you be able to implement it?

No

Further information

npm install ajv
npm install ajv-cli

echo '{ "properties": { "ts": { "type": "timestamp" } } }'  > schema.json
echo '{ "ts": "2025-07-01T12:34:00+01:00" }'                > ts1.json
echo '{ "ts": "2025-07-01T12:34:00+01:00[Europe/London]" }' > ts2.json

ajv --spec=jtd -s schema.json -d ts1.json -d ts2.json

... results in

ts1.json valid
ts2.json invalid
[
  {
    instancePath: '/ts',
    schemaPath: '/properties/ts/type',
    keyword: 'type',
    params: { type: 'timestamp', nullable: false },
    message: 'must be timestamp'
  }
]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions