time-rs / time

The most used Rust library for date and time handling.
https://time-rs.github.io
Apache License 2.0
1.1k stars 277 forks source link

ISO6801 and a SPACE instead of a T #644

Closed eyyyyyyy3 closed 8 months ago

eyyyyyyy3 commented 8 months ago

Hello. According to the ISO 6801 standard the T doesn't have to be there it can also be replaced by a space.

I mean the linked page in the wiki has a example of the ISO8601 standard with a space instead of a T. THE ISO STANDARD IN QUESTION For example, September 27, 2022 at 6 p.m. is represented as 2022-09-27 18:00:00.000.

Wikipedia

A single point in time can be represented by concatenating a complete date expression, the letter "T" as a delimiter, and a valid time expression. For example, "2007-04-05T14:30". In ISO 8601:2004 it was permitted to omit the "T" character by mutual agreement as in "200704051430",[37] but this provision was removed in ISO 8601-1:2019. Separating date and time parts with other characters such as space is not allowed in ISO 8601, but allowed in its profile RFC 3339.[38]

It kinda seems that the people who write the standards don't know what they're doing themselves but it would be nice if we could also have that option to parse a with a space instead of a T that is.

As a final argument for it's implementation, postgresql also supports the with a space version in its timestamptz type.

If I have missed a function that does what I have described sorry for wasting your time XD. (where can i find it)

eyyyyyyy3 commented 8 months ago

This is really similar to #595

jhpratt commented 8 months ago

Given that you've already found that issue, you'll see in it that the specification does not permit a space.