Skip to content

[ML] ScheduledEvent takes and stores ZonedDateTime but then discards the timezone #38620

@droberts195

Description

@droberts195

(Noticed while fixing #38506)

The ScheduledEvent class's constructor takes ZonedDateTime for both startTime and endTime. However, when serialising both on the wire and as XContent it ditches the time zone and converts to an Instant. It would make more sense to store Instant, take Instants in the constructor and return Instants from the accessors. Then it would be completely clear to all users that the class was not preserving the time zone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions