-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Proposal: date-time format that requires timezone information #1498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
JSON Schema's Am I misreading this? |
Hi @handrews . You are correct indeed! I assumed otherwise because Newtonsoft JSON doesn't even have an option to enforce it, while it is the de-facto standard JSON serialization library for .NET (even Microsoft uses it for ASP.NET Core framework). Looks like I need to raise it with them then :) |
The
date-time
format allows both local and 'timezoned' values (both are allowed by ISO_8601).Although there can be use cases where local time is desired (say, flight arrival time at destination, without having to know the timezone offset at that date), in a great number of cases allowing the lack of timezone information is undesired, because it is unclear what the local time is supposed to be (browser clients can be in any timezone).
In fact, from my experience, sending a 'timezoneless' value will most often be a sign of a bug in the client (someone forgetting to use a proper UTC backed value or forgot to apply correct formatting), while the server accepting such a value will be a bug on the server - insufficient validation. Both of them combined will inevitably lead to a hard-to-spot data corruption.
date-time-localizable
,date-time-convertible
,date-time-tz
, but feel free to suggest better ones.date-time-local
ordate-time-no-tz
,date-time-without-tz
,date-time-tz-free
.(I'm especially interested in number 1. Number 2 is mostly as a side-suggestion to get feedback for.)
The text was updated successfully, but these errors were encountered: