Date and time types
isoDate
Section titled “isoDate”A date on a calendar in ISO 8601 format YYYY-MM-DD.
A JSON example of this model.
"2025-01-01"
The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: isoDate.yamltype: stringformat: dateexamples: - 2025-01-01description: A date on a calendar in ISO 8601 format YYYY-MM-DD
The TypeSpec code for this model.
/** A date on a calendar in ISO 8601 format YYYY-MM-DD */@example(isoDate.fromISO("2025-01-01"))scalar isoDate extends plainDate;
isoTime
Section titled “isoTime”A time on a clock, without a timezone, in ISO 8601 format HH:mm:ss.
A JSON example of this model.
"17:00:00"
The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: isoTime.yamltype: stringformat: timeexamples: - 17:00:00description: A time on a clock, without a timezone, in ISO 8601 format HH:mm:ss
The TypeSpec code for this model.
/** A time on a clock, without a timezone, in ISO 8601 format HH:mm:ss */@example(isoTime.fromISO("17:00:00"))scalar isoTime extends plainTime;
utcDateTime
Section titled “utcDateTime”A date and time with timezone in ISO 8601 format YYYY-MM-DDThh:mm:ssZ.
A JSON example of this model.
"2024-02-28T17:00:00Z"
The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: utcDateTime.yamltype: stringformat: date-timedescription: A date and time with timezone in ISO 8601 format YYYY-MM-DDThh:mm:ssZ
offsetDateTime
Section titled “offsetDateTime”A date and time with timezone in ISO 8601 format YYYY-MM-DDThh:mm:ss±hh:mm.
A JSON example of this model.
"2024-02-28T17:00:00+01:00"
The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: offsetDateTime.yamltype: stringformat: date-timedescription: A date and time with timezone in ISO 8601 format YYYY-MM-DDThh:mm:ss±hh:mm
calendarYear
Section titled “calendarYear”A calendar year in the format YYYY.
A JSON example of this model.
"2025"
The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: calendarYear.yamltype: stringexamples: - "2025"pattern: ^[0-9]{4}$description: A calendar year
The TypeSpec code for this model.
/** A calendar year */@example("2025")@pattern("^[0-9]{4}$")@Versioning.added(CommonGrants.Versions.v0_2)scalar calendarYear extends string;