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

Timestamps: ISO8601 or RFC3339? #7

Closed
torgo opened this issue Jan 11, 2016 · 12 comments
Closed

Timestamps: ISO8601 or RFC3339? #7

torgo opened this issue Jan 11, 2016 · 12 comments

Comments

@torgo
Copy link
Contributor

torgo commented Jan 11, 2016

@philandstuff asks: on a practical level, why might one prefer RFC 3339 or ISO 8601 as a datetime standard? I'm considering adopting RFC3339 for #registers because it's freely available and simpler

@torgo
Copy link
Contributor Author

torgo commented Jan 11, 2016

I agree with using RFC3339. Unless you want to talk about dates before the common era (BC). Any other thoughts? What are other efforts using for timestamps?

@adamkcooper
Copy link

Interestingly XML schema and its dateTime type follows ISO 8601. So anyone
using SAML or XML schema may have other views.

The point is we just need to be clear about standards in a particular
context.

On Monday, 11 January 2016, Daniel Appelquist <notifications@github.com
javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

I agree with using RFC3339. Unless you want to talk about dates before the
common era (BC). Any other thoughts? What are other efforts using for
timestamps?


Reply to this email directly or view it on GitHub
#7 (comment)
.

Adam Cooper
Identity Assurance Programme
Government Digital Service
125 Kingsway, London, WC2B 6NH

Tel: 07973 123 038
official: adam.cooper@digital.cabinet-office.gov.uk
official sensitive: adam.cooper@govdigital.gsi.gov.uk

@philandstuff
Copy link

I think it's worth being clear about the relationship between RFC 3339 and ISO 8601. RFC 3339 is based on ISO 8601 and in fact includes an Internet profile of ISO 8601. However, RFC 3339 §5.5 says:

The complete set of date and time formats specified in ISO 8601
[ISO8601] is quite complex in an attempt to provide multiple
representations and partial representations. Appendix A contains an
attempt to translate the complete syntax of ISO 8601 into ABNF.
Internet protocols have somewhat different requirements and
simplicity has proved to be an important characteristic. In
addition, Internet protocols usually need complete specification of
data in order to achieve true interoperability. Therefore, the
complete grammar for ISO 8601 is deemed too complex for most Internet
protocols.

From my point of view, I would say that where RFC3339 is sufficient for a given set of requirements, then it's advisable to use it alone (not full ISO 8601) to maintain simplicity.

@torgo
Copy link
Contributor Author

torgo commented Jan 11, 2016

Thanks @philandstuff. I think your statement above could be a good example of “standards guidance” that this community could be issuing. Placeholder here: https://alphagov.github.com/tech-and-data-standards/guidance/timestamps/

@torgo
Copy link
Contributor Author

torgo commented Feb 22, 2016

Some additions from @robyoung : 4fe462a

@danielquinn
Copy link

After reading RFC-3339, a 17-page document in which not a single working example is given, I still have no idea what such a time representation looks like and how it differs from ISO-8601. In fact, when I search for RFC 3339, the very first hit is the Wikipedia page for ISO-8601.

If we're trying to establish a standards document of some kind, can we perhaps include a human-friendly example of what's being recommended?

@davidread
Copy link

I guess you missed page 9 of RFC-3339, which is the examples section. But you're right, more useful to this discussion would an be analysis of what it doesn't have, compared to ISO-8601.

BTW The wikipedia page is shown only at the top of the search results only because of some Duck Duck Go specific thing. Google doesn't show it, for example.

@benbasson
Copy link

A question on Stack Overflow sums up the relationship quite nicely...

Most notably RFC 3339 requires a complete representation of date and time (only fractional seconds are optional). The RFC also has some small, subtle differences. For example truncated representations of years with only two digits are not allowed -- RFC 3339 requires 4-digit years, and the RFC only allows a period character to be used as the decimal point for fractional seconds.

@philandstuff
Copy link

Interesting prior art from a non-normative w3c note: https://www.w3.org/TR/NOTE-datetime

   Year:
      YYYY (eg 1997)
   Year and month:
      YYYY-MM (eg 1997-07)
   Complete date:
      YYYY-MM-DD (eg 1997-07-16)
   Complete date plus hours and minutes:
      YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)
   Complete date plus hours, minutes and seconds:
      YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)
   Complete date plus hours, minutes, seconds and a decimal fraction of a
second
      YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)

this allows more possibilities that RFC 3339 -- ie you can specify things less precisely than to the second, and in particular you can specify dates, months and years -- but is open without restriction, unlike ISO 8601.

@torgo
Copy link
Contributor Author

torgo commented Jul 15, 2016

NB this topic has come up again in the Open Standards Hub.

@Lawrence-G
Copy link
Contributor

This discussion is now relevant to the Date-Times and Time-stamps standards challenge which is now open for responses - The suggested solution is ISO 8601 notation for dates and times in online documents, spreadsheets, databases and for filenames and online references such as URLs. As with previous challenges, the comments and responses made contribute to the final proposal for the approach to meeting a challenge with a standard. Please add new comments to the challenge/issue.

@Lawrence-G
Copy link
Contributor

Now #37 has taken these points into the conversation.

@timneedham timneedham mentioned this issue Jul 20, 2018
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants