relvacode / iso8601

A fast ISO8601 date parser for Go
MIT License
144 stars 16 forks source link

Support "YYYY-MM-DD HH:MM:SS.mmmmmm" format #20

Open Code-Hex opened 1 year ago

Code-Hex commented 1 year ago

Thanks for making the great library!

Do you have plans to support a parser that allows spaces instead of the 'T' character in the format YYYY-MM-DD HH:MM:SS.mmmmmm?

Quoting an earlier version of the ISO 8601 standard, section 4.3.2:

The character [T] shall be used as time designator to indicate the start of the representation of the time of day component in these expressions. [...]

NOTE By mutual agreement of the partners in information interchange, the character [T] may be omitted in applications where there is no risk of confusing a date and time of day representation with others defined in this International Standard.

https://stackoverflow.com/questions/9531524/in-an-iso-8601-date-is-the-t-character-mandatory

relvacode commented 7 months ago

Hi there,

The goal of this library was always for interop with other languages/interfaces that don't follow RFC3339 in a way the stdlib time understands.

The StackOverflow you quoted is conflicting, and really, so is this whole standard. I'd be tempted to keep T enforced less this library start supporting any separator value unless you've found a case of this in the wild?