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

DateTime without the timezone cannot be parsed #118

Open
andacata opened this issue Jun 27, 2024 · 0 comments
Open

DateTime without the timezone cannot be parsed #118

andacata opened this issue Jun 27, 2024 · 0 comments
Labels
bug Something isn't working module: all

Comments

@andacata
Copy link
Contributor

When the DateTime does not include the timezone, the Instant.parse() call is generating an exception.
java.time.format.DateTimeParseException: Text '2019-01-28T12:00:00' could not be parsed at index 19

The documentation of OCPI 2.2.1 states that it will be possible to receive timestamps without the timezone:

16.2. DateTime type
All timestamps are formatted as string(25) following RFC 3339, with some additional limitations.
All timestamps SHALL be in UTC. The absence of the timezone designator implies a UTC timestamp. Fractional seconds MAY be used.
Example of how timestamps shall be formatted in OCPI, other formats/patterns are not allowed:

2015-06-29T20:39:09Z
2015-06-29T20:39:09
2016-12-29T17:45:09.2Z
2016-12-29T17:45:09.2
2018-01-01T01:08:01.123Z
2018-01-01T01:08:01.123

NOTE +00:00 is not the same as UTC.

@lilgallon lilgallon added bug Something isn't working module: all labels Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module: all
Projects
None yet
Development

No branches or pull requests

2 participants