ZoneOffset range(TemporalField field)
gets the range of valid values for the specified field.
range
has the following syntax.
public ValueRange range(TemporalField field)
The following example shows how to use range
.
import java.time.ZoneOffset; import java.time.temporal.ChronoField; import java.time.temporal.ValueRange; //w w w.j a v a2 s . c om public class Main { public static void main(String[] args) { ZoneOffset z = ZoneOffset.UTC; ValueRange t = z.range(ChronoField.OFFSET_SECONDS); System.out.println(t); } }
The code above generates the following result.