-
Notifications
You must be signed in to change notification settings - Fork 438
Description
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).