ZoneOffset getRules() method in Java with Examples Last Updated : 13 Dec, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report The getRules() method of ZoneOffset Class in java.time package is used to get the associated time-zone rules of this ZoneOffset instance. This method takes returns ZoneRules of this ZoneOffset instance. Syntax: public ZoneRules getRules() Parameters: This method do not accepts any parameter. Return Value: This method returns a ZoneRules which is the ZoneRules associated with this ZoneOffset instance. Below examples illustrate the ZoneOffset.getRules() method: Example 1: Java // Java code to illustrate getRules() method import java.time.*; public class GFG { public static void main(String[] args) { // Get the ZoneOffset instance ZoneOffset zoneOffset = ZoneOffset.of("+05:30"); System.out.println("ZoneOffset: " + zoneOffset); // Using getRules() method System.out.println("ZoneRules: " + zoneOffset.getRules()); } } Output: ZoneOffset: +05:30 ZoneRules: ZoneRules[currentStandardOffset=+05:30] Example 2: Java // Java code to illustrate getRules() method import java.time.*; import java.time.temporal.*; public class GFG { public static void main(String[] args) { // Get the ZoneOffset instance ZoneOffset zoneOffset = ZoneOffset.of("Z"); System.out.println("ZoneOffset: " + zoneOffset); // Using getRules() method System.out.println("ZoneRules: " + zoneOffset.getRules()); } } Output: ZoneOffset: Z ZoneRules: ZoneRules[currentStandardOffset=Z] Reference: Oracle Doc Comment More infoAdvertise with us Next Article ZoneId getRules() method in Java with Examples C code_r Follow Improve Article Tags : Java Java-Functions Java-time package Java-ZoneOffset Practice Tags : Java Similar Reads ZoneOffset getId() method in Java with Examples The getId() method of ZoneOffset Class in java.time package is used to obtain offset ID in this instance of ZoneOffset. This method does not takes any parameter and returns an String value. which is the offset ID. Syntax: public static String getId() Parameters: This method accepts do not accepts an 1 min read ZoneId getRules() method in Java with Examples The getRules() method of the ZoneId class in Java is used to get the time-zone rules for this ID allowing calculations to be performed. The rules provide the functionality associated with a time-zone like an offset for a given instant or local date-time. The rules are supplied by ZoneRulesProvider. 1 min read ZoneOffset getAvailableZoneIds() method in Java with Examples The getAvailableZoneIds() method of the ZoneOffset class of java.time package is used to get the set of available zone IDs. This set includes all available region-based IDs. The ID can be passed to of(String) to create a ZoneId. The set of zone IDs can increase over time, although in a typical appli 2 min read ZoneOffset hashCode() method in Java with Examples The hashCode() method of ZoneOffset Class in java.time package is used to obtain hashCode value of this instance of ZoneOffset. This method does not takes any parameter and returns an int value. which is the hashCode value. Syntax: public static int hashCode() Parameters: This method accepts do not 1 min read ZoneOffset toString() method in Java with Examples The toString() method of ZoneOffset Class in java.time package is used to obtain String representation of this instance of ZoneOffset. This method does not takes any parameter and returns an String value. which is the String representation. Syntax: public static String toString() Parameters: This me 1 min read ZoneOffsetTransitionRule getLocalTime() method in Java with Example The getLocalTime() method of java.time.zone.ZoneOffsetTransitionRule class is used to get the object of local time with respect to which the transition took place. Syntax: public LocalTime getLocalTime() Parameter: this method does not accept any parameter. Return Value: This method returns the obje 2 min read Like