Java Date Time Java Java API
java.time.ZoneId
public abstract ZoneRules getRules()
Returns the time-zone rules for this zone id. The rules provide the functionality associated with a time-zone, such as finding the offset for a given instant or local date-time.
package com.logicbig.example.zoneid;import java.time.ZoneId;import java.time.ZonedDateTime;import java.time.zone.ZoneRules;public class GetRulesExample { public static void main(String... args) { ZoneId z = ZonedDateTime.now().getZone(); ZoneRules rules = z.getRules(); System.out.println(rules); }}
ZoneRules[currentStandardOffset=-06:00]