Reputation: 100
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
Reputation: 3967
"2021-12-30T10:00:00.123z" ends with a 'z'.
This means this DateTime represents UTC time.
UTC is sometimes known as "Zulu time"
Upvotes: 3