Skip to content
This repository was archived by the owner on Jan 1, 2023. It is now read-only.
This repository was archived by the owner on Jan 1, 2023. It is now read-only.

Gracefully accept more than 9 digits on the seconds fraction #1

@addicticks-dev

Description

@addicticks-dev

In XML Schema type xsd:time and xsd:dateTime can have an unlimited number of digits on the fractional seconds. For example the value

"23:30:28.123456789012345678901234567890Z"

is a perfectly legal xsd:time value according to the XML Schema specification. However, this poses a problem when converting to Java's OffsetDateTime and OffsetTime as these will only allow up to 9 digits precision on the fractional seconds.

Currently parsing a value such as the one above will cause a DateTimeParseException.

The proposal is to able to handle this situation gracefully, meaning that fractional digits after the 9th digit are simply ignored. It is believed that this truncation is always acceptable to all users of the library and is much better than throwing an exception.

The scenario is rare and therefore any solution which handles it must not have adverse performance effect on the 99.99% of date/time values which can be parsed without problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions