Skip to content
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

Add new rule: "SHOULD select appropriate one of date or date-time format" #808

Merged
merged 11 commits into from
May 6, 2024
15 changes: 15 additions & 0 deletions chapters/data-formats.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,21 @@ issues with precision, e.g. whether to represent a timestamp as 1460062925,
more effort to parse, avoid this ambiguity.


[#255]
== {SHOULD} select appropriate one of date or date-time format

When choosing between `date` and `datetime` formats you should take into account the following:

* `date` should be used for properties that are not time-sensitive or where precise timing is not required,
vadimturkov marked this conversation as resolved.
Show resolved Hide resolved
for instance, document dates, birthdays, ETAs (estimated time of arrival).
Normally date without time implies the time period from midnight to midnight in the local time zone.
vadimturkov marked this conversation as resolved.
Show resolved Hide resolved
Since time zone information is absent in the property value, it must be documented and can be also provided
vadimturkov marked this conversation as resolved.
Show resolved Hide resolved
as an additional context via other fields indicating location.
vadimturkov marked this conversation as resolved.
Show resolved Hide resolved
* `datetime` should be used in all other cases to indicate instants/moments in time.
vadimturkov marked this conversation as resolved.
Show resolved Hide resolved
This format requires the explicit time zone offset to be provided,
vadimturkov marked this conversation as resolved.
Show resolved Hide resolved
which avoids misinterpretations and eliminates the need of an additional context to provide.


[#127]
== {SHOULD} use standard formats for time duration and interval properties

Expand Down
Loading