Does Java 8’s new Java Date Time API take care of DST?

It depends on which class you use:

  • Instant is an instantaneous point on the global time-line (UTC), and is unrelated to time-zone.
  • LocalDate and LocalDateTime have no concept of time-zone, but calling now() will of course give you your correct time.
  • OffsetDateTime has a time-zone, but doesn’t support Daylight Savings Time.
  • ZonedDateTime has full time-zone support.

Converting between them usually requires a time-zone, so to answer your question:

    Yes, Java 8 Date/Time can take care of DST, if you use it right.

Leave a Comment