ZoneId getRules() example
Description
ZoneId getRules()
gets the time-zone rules for this ID allowing calculations to be performed.
Syntax
getRules
has the following syntax.
public abstract ZoneRules getRules()
Example
The following example shows how to use getRules
.
import java.time.ZoneId;
import java.time.zone.ZoneRules;
//www .j a v a 2 s .c o m
public class Main {
public static void main(String[] args) {
ZoneId z = ZoneId.systemDefault();
ZoneRules r = z.getRules();
System.out.println(r);
}
}
The code above generates the following result.