4

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

Basil Bourque
  • 262,936
  • 84
  • 758
  • 1,028

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,014
  • 29
  • 84
  • 132