Skip to content

How to implement appointments that are not a point on the global timeline #854

@danielrohe

Description

@danielrohe

One of the questions that is often raised is how to implement appointments or schedules that are not points on the global timeline in an API and can't be expressed with an offset.

For an appointment as yourself if the timezone transition rules change tomorrow (e.g., daylight saving time is abolished), should the point on the global timeline move?" If the answer is no (the UTC instant must stay fixed), you have a moment - use Instant, OffsetDateTime, or ZonedDateTime. If the answer is yes (the local wall clock time should stay the same, even if that means a different UTC instant), you have a not-a-moment - use LocalDate, LocalTime, or LocalDateTime combined with ZoneId. For example: A meeting that happened last Tuesday at 14:00 Berlin time is a moment (the UTC instant is fixed). But a recurring weekly meeting "every Tuesday at 14:00 Berlin time" is a not-a-moment (the local time stays at 14:00 regardless of DST changes, which means the UTC instant shifts).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions