3

How to ask a java.time.ZonedDateTime object if Daylight Saving Time (DST) applies to its moment or if standard time applies?

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154

1 Answers1

4

@Jon's answer is good. Just want to mention there is ZoneRules#isDaylightSavings available.

ZonedDateTime zdt = ...;
ZoneRules rules = zdt.getZone().getRules();
boolean isDst = rules.isDaylightSavings(zdt.toInstant());

And possible duplicate question here.

Community
  • 1
  • 1
Terry Li
  • 16,870
  • 30
  • 89
  • 134