Onkar Patil
Onkar Patil

Reputation: 100

OpenAPi DateTime with timezone information

I am creating OpenApi Doc for an API. Having a model object field with DateTime info with timezone.
Example: "2021-12-30T10:00:00+00:00"
The expected input date should be in UTC.

If I use the format: "date-time" then the corresponding generated example is "2021-12-30T10:00:00.123z" where timezone information is missing.

Please suggest the right format to use in the OpenApi spec so that I can get the desired DateTime with a timezone value.

Upvotes: 4

Views: 8218

Answers (1)

Markus Meyer
Markus Meyer

Reputation: 3967

"2021-12-30T10:00:00.123z" ends with a 'z'.
This means this DateTime represents UTC time.

z stands for Zulu Timezone

UTC is sometimes known as "Zulu time"

Upvotes: 3

Related Questions