frictionlessdata / tableschema-java

A Java library for working with Table Schema.
MIT License
25 stars 21 forks source link

DateTime is not respecting optional decimal seconds and timezone correctly #62

Closed jonesaaronj closed 2 years ago

jonesaaronj commented 3 years ago

Overview

The DateTime spec for ISO-8601 allows for the decimal seconds and timezone to be optional

1111-11-11T11:11:11 fails 1111-11-11T11:11:11.555Z passes


Please preserve this line to notify @iSnow (lead of this repository)

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

gmeriaux commented 2 years ago

I notice also this issue and if we respect table-schema definition, datetime MUST be in ISO 8601 format of YYYY-MM-DDThh:mm:ssZ in UTC time. When I look in DatetimeField, I am seeing : formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ") I think you have to replace it by formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss[.SSS]Z") milliseconds are optionnal in the ISO 8601 standard