-
Notifications
You must be signed in to change notification settings - Fork 29
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
[BUG] Regex for xs:dateTime does not properly support timezones #498
Comments
This is actually more complex as I described in aas-core-works/aas-core-meta#355 (comment) Copying my response from there
The issue here is that the Type is dateTime which is defined as xs:dateTime, meaning it can have any timezone. However, the explanation column states that the timestamp should/must(?) be in UTC. Based on that you introduced a new "type" Date_time_UTC. I would argue that the specification is wrong or at least inconsistent as the type information is constrained by the explanation to an undefined type "dateTimeUTC". The correct way to handle this would be to change the specification to either defined the type dateTimeUTC or to remove the UTC restriction in the explanation. |
I imagine to remember that there was once a decision that the timestamps must all be defined in UTC, but maybe @BirgitBoss could clarify this? |
So far the type "timestamp" is only used in the experimental Event. For me the specification is clear: UTC is required. The specification is not wrong. Of course it can be improved by introducing a new data type dateTimeUtc. The naming would hinder to include other time zones later. A more generic name would be eventTime but this is probably too specific. if the schemas are already supporting UTC only, then I consider this to be a backward compatible change and an improvement of the documentation only. @s-heppner what about xml and rdf? |
@BirgitBoss Although you are right that in the meta model classes Right now, the definition of Additionally, the description of BasicEventElement.lastUpdate says "UTC only" while to type used does allow time zones. So my proposal is to strictly follow |
As far as I see the schemas do not provide regEx for the enumeration values in DataTypeDefXsd only for the elements within the Metamodel lastUpdate and timeStamp. In aas-core we have https://aas-core-works.github.io/aas-core-meta/v3_1/MatchesXsDateTimeUtc.html and https://aas-core-works.github.io/aas-core-meta/v3_1/MatchesXsDateTime.html: so everything should be fine, no? For changing the UTC restriction for these two Event attributes please add a separate issue. Thank you! |
Describe the bug
The regex for values of type xs:dateType
does only allow
Z
,+00:00
, or-00:00
as timezones.Correct behavior would be to allow
Z
or any other timezone of format(+|-)[0-9]{2}:[0-9]{2}
.Where
aas-specs/schemas/json/aas.json
Line 224 in 04a1f04
aas-specs/schemas/json/aas.json
Line 622 in 04a1f04
Additional context
https://www.w3.org/TR/xmlschema-2/#dateTime Section 3.2.7.3
The text was updated successfully, but these errors were encountered: