3

I have the following code below:

ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant(
            this.start.toLocalDateTime(), ZoneOffset.UTC,
            ZoneOffset.systemDefault());

The this.start is from a java.sql.Timestamp. I am explicitly converting from UTC here to the system's local offset, will this be smarty enough to take into account daylight savings?

Darren
  • 10,631
  • 8
  • 42
  • 64

1 Answers1

5

ZonedDateTime takes daylight savings into account. That's what differs it from LocalDateTime. Well, that and timezone information.

Avneet Paul
  • 293
  • 1
  • 7