Java Date Time - ZoneOffset getRules() example








ZoneOffset getRules() gets the associated time-zone rules.

Syntax

getRules has the following syntax.

public ZoneRules getRules()

Example

The following example shows how to use getRules.

import java.time.ZoneOffset;
import java.time.zone.ZoneRules;
/*from   w  w w  .  j  a  v  a 2  s.c o m*/
public class Main {
  public static void main(String[] args) {
    ZoneOffset z = ZoneOffset.UTC;
    ZoneRules t = z.getRules();
    System.out.println(t);
  }
}

The code above generates the following result.