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

Timestamp parsing fails with iso8601 datetime format from CSV #355

Open
michity15169 opened this issue Jul 27, 2022 · 0 comments
Open

Timestamp parsing fails with iso8601 datetime format from CSV #355

michity15169 opened this issue Jul 27, 2022 · 0 comments

Comments

@michity15169
Copy link
Contributor

According to the manual, the Timestamp included in the CSV must be ISO 8601 compliant.
https://github.com/cloudspannerecosystem/harbourbridge/tree/master/sources/csv

- The only supported timestamp format right now is **ISO 8601**.

ISO 8601 states that dates and times are concatenated with a "T" as the delimiter.
https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations
However, the layout string currently used for parsing is as follows.

https://github.com/cloudspannerecosystem/harbourbridge/blob/master/sources/csv/data.go#L511

func convTimestamp(val string) (t time.Time, err error) {
        t, err = time.Parse("2006-01-02 15:04:05", val)

The current layout string does not match the representation of date and time combinations defined in ISO 8601.
I think the intersection of RFC3339 and ISO8601 is the most common layout
cf) https://ijmacd.github.io/rfc3339-iso8601/

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

1 participant