ocpi-toolkit icon indicating copy to clipboard operation
ocpi-toolkit copied to clipboard

DateTime without the timezone cannot be parsed

Open andacata opened this issue 8 months ago • 0 comments

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.

andacata avatar Jun 27 '24 16:06 andacata