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

Allow space to seperate date and time as per RFC3339 #424

Closed
johanfange opened this issue Jul 29, 2016 · 5 comments
Closed

Allow space to seperate date and time as per RFC3339 #424

johanfange opened this issue Jul 29, 2016 · 5 comments

Comments

@johanfange
Copy link

With the recent exciting addition of better support for time and date with #414, I think it's time to reconsider the decision to not to allow spaces in date-times (see #279).

For example, compare the time of the moon landing with/without T:

datetime = 1969-07-20T20:18
google_results = 7

datetime = 1969-07-20 20:18
google_results = 5360

Another famous (less pleasant) date:

datetime = 2001-09-11 10:28
google_results = 87_900

datetime = 2001-09-11T10:28
google_results = 7

Seems to me that allowing a space as well would fit the "obvious" part of TOML very well here. The format appears to be several orders of magnitude more popular. In fact, I'd go so far as saying that using T in datetimes is a rather obscure format used only by programmers who have read the Wikipedia page of ISO 8601/RFC3339, as opposed to normal users. While I personally find using a T rather neat, it's not so good for readability.

As for complexity, I believe the addition of allowing a space between date and time ("T" / " ") would be trivial.

@alarvi
Copy link

alarvi commented Sep 15, 2016

But doesn't the RFC 3339 specify that "T" must be present between date and time? Your change would effectively make toml Datetime format not compliant with the RFC.

@Hrxn
Copy link

Hrxn commented Sep 16, 2016

Not necessarily..

NOTE: ISO 8601 defines date and time separated by "T".
Applications using this syntax may choose, for the sake of
readability, to specify a full-date and full-time separated by
(say) a space character.

@alarvi
Copy link

alarvi commented Sep 16, 2016

That's right, but the RCF 3339 removes that possibility to remove ambiguity (see Apendix A) and toml specs follow the RFC not the ISO.

ISO 8601 states that the "T" may be omitted under some
circumstances. This grammar requires the "T" to avoid ambiguity.

@Hrxn
Copy link

Hrxn commented Sep 16, 2016

I'm all for making this mandatory, displaying a different variant should be left to the user interface / front-end side.

@johanfange
Copy link
Author

That's right, but the RCF 3339 removes that possibility to remove ambiguity (see Apendix A) and toml specs follow the RFC not the ISO.

ISO 8601 allows the delimiter T to be omitted. I think this means that you may write: 2007-04-0514:30 or even 200704051430 instead of 2007-04-05T14:30, if this has been agreed upon. The RFC does not allow this, and requires a delimiter (whether that delimiter be T, t or ).

This is a different issue from allowing space in addition to T. The RFC specifically mentions that applications may allow space for readability. See https://tools.ietf.org/html/rfc3339#section-5.6

This also introduces no ambiguity in the grammar, and is a commonly used format compared to the T-variant, as seen in the number of search results mentioned above.

I think readability is a very important part of being "obvious".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants