Skip to content

Commit

Permalink
Merge pull request #806 from nexusformat/805-time_zone
Browse files Browse the repository at this point in the history
recommend providing time zone in NX_DATE_TIME
  • Loading branch information
yayahjb authored Oct 19, 2020
2 parents 615df1e + effaa2b commit cbc1cf0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
16 changes: 12 additions & 4 deletions manual/source/datarules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,22 @@ NeXus dates and times

NeXus :index:`dates and times <date and time>`
should be stored using the `ISO 8601`_ [#]_ format,
e.g. ``1996-07-31T21:15:22+0600``.
e.g. ``1996-07-31T21:15:22+0600`` (which includes
a time zone offset of ``+0600``).
Note: The time zone offset is always numeric or ``Z`` (which means UTC).
The standard also allows for time intervals in fractional seconds
with *1 or more digits of precision*.
This avoids confusion, e.g. between U.S. and European conventions,
and is appropriate for machine sorting.

.. _ISO 8601: http://www.w3.org/TR/NOTE-datetime
.. [#] ISO 8601: http://www.w3.org/TR/NOTE-datetime
It is recommended to add an explicit time zone,
otherwise the local time zone is assumed per ISO8601.
The norm is that if there is no time zone, it is assumed
local time, however, when a file moves from one country to
another it is undefined. If the local time zone is written,
the ambiguity is gone.

.. _ISO 8601: https://www.w3.org/TR/NOTE-datetime
.. [#] ISO 8601: https://www.w3.org/TR/NOTE-datetime
.. compound::
Expand Down
16 changes: 14 additions & 2 deletions nxdlTypes.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,26 @@

<xs:simpleType name="NX_DATE_TIME">
<xs:annotation>
<xs:documentation>alias for the ISO8601 date/time stamp</xs:documentation>
<xs:documentation>
Alias for the ``ISO8601`` date/time stamp.
It is recommended to add an explicit time zone,
otherwise the local time zone is assumed per ISO8601.
</xs:documentation>
</xs:annotation>
<xs:restriction base="nxdl:ISO8601" />
</xs:simpleType>

<xs:simpleType name="ISO8601">
<xs:annotation>
<xs:documentation>ISO8601 date/time stamp</xs:documentation>
<xs:documentation>
ISO8601 date/time stamp.
It is recommended to add an explicit time zone,
otherwise the local time zone *is assumed* per ISO8601.
The norm is that if there is no time zone, it is assumed
local time, however, when a file moves from one country to
another it is undefined. If the local time zone is written,
the ambiguity is gone.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:dateTime" />
</xs:simpleType>
Expand Down

0 comments on commit cbc1cf0

Please sign in to comment.