-
Notifications
You must be signed in to change notification settings - Fork 16
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
UTC only datetimes #12
Conversation
All datetimes are now forced to end with a `Z` which disables the possibility to set a time zone and also explicitly marks every datetime as being UTC.
This sounds like a good idea in general to me. However, I do not think a pattern is the right way to do this. See this section of the xschema docs: A better way would be to use a fixed=true, value=Z explicitTimezone. |
Take this comment back, looks like the explicitTimezone allows specifying if the timezone is required or not, but not what it actually is (ie Z). So if the timezone is going to be required, it might be useful to set
but the pattern would still be needed to check for just Z. |
I also tried this but The current implementation is pretty save as it combines all the default date time restrictions that make sure that its a valid date time with the pattern that asserts it ends with |
Also sent to fdsn email list, but just to preserve for future reference in case of wanting full regex for datetime:
|
I does not appear to have arrived on the list. It is not really needed here as the base |
Thread on the mailing list: http://www.fdsn.org/message-center/thread/464/ |
This changes forces all datetimes in a StationXML file to end with a
Z
. This explicitly marks them as being in UTC which (according to the SEED standard) must be given in any case.Motivation
It is currently possible to have non-UTC datetimes in a StationXML file (e.g.
2013-01-01T00:00:00+07:00
). While this is not allowed according to the SEED standard the schema does not prevent it and any XML file with this would still validate just fine.The forced
Z
at the end explicitly marks a time as being UTC and as a consequence also forbids setting any time zone.While the schema alone will never be enough to define the semantics of StationXML it should be sufficient to define its syntax. This change is a small step in that direction.
StationXML would additionally gain a more consistent datetime representation.
Potential Impact
Little. Existing implementations would have to be changed to add a
Z
at the end and remove time zones (if any). Considering implementations would have to at least up the version number if they update to a new StationXML version this is really no big problem.Other Possibilities
It would also be possibly (with a more complex regular expression) to not have the
Z
at the end and still disallow timezones. I personally prefer the current approach as it is more explicit.