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

Support comma as decimal separator #1

Open
yuzhichang opened this issue Apr 23, 2021 · 3 comments
Open

Support comma as decimal separator #1

yuzhichang opened this issue Apr 23, 2021 · 3 comments

Comments

@yuzhichang
Copy link

$ date --iso-8601=ns
2021-04-23T09:17:28,235575783+08:00    //on Ubuntu 20.4
2021-04-23T09:18:11,357706892+0800     //on CentOS 7.6

This library failed to parse these formats.

@btubbs
Copy link
Owner

btubbs commented Apr 27, 2021

Interesting. I've never seen commas used for the nanosecond part. Is that in the iso8601 spec?

@btubbs
Copy link
Owner

btubbs commented Apr 27, 2021

Seems like it is. But this library is similar to most in not supporting the comma. Found discussion here. https://stackoverflow.com/questions/20699705/why-does-the-iso-8601-specification-appear-to-be-universally-ignored-when-it-com

I'll update this issue to be a feature request for supporting commas as an additional decimal separator.

@btubbs btubbs changed the title Failed to parse "date" output Support comma as decimal separator Apr 27, 2021
@yuzhichang
Copy link
Author

@btubbs go 1.17 supports commas

The package now accepts comma "," as a separator for fractional seconds when parsing and formatting time. For example, the following time layouts are now accepted:

2006-01-02 15:04:05,999999999 -0700 MST
Mon Jan _2 15:04:05,000000 2006
Monday, January 2 15:04:05,000 2006

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

2 participants