Skip to content

Adding DateTimePeriod to Instant is not fully ISO-8601-compliant #487

Open
@dkhalanskyjb

Description

@dkhalanskyjb

ISO 8601 defines the period of one month as a fixed number of calendar days, specified by the calendar.

In DateTimePeriod + Instant arithmetics, we treat a month as a separate time scale unit, namely, we resolve the LocalDateTime on which we perform arithmetics internally after adding the months but before adding the days.

Adding months and days should instead be done as a single change, only consulting the calendar, and the time zone should only be used once all calendar-based operations are performed.

Earlier, I attempted to implement a solution in (#330) and didn't create an issue ticket, hoping for a quick resolution, but at this point, I should file it so that this doesn't get forgotten about.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions