OffsetTime 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.OffsetTime; import java.time.temporal.ChronoField; import java.time.temporal.ValueRange; /* ww w . ja v a2 s.c o m*/ public class Main { public static void main(String[] args) { OffsetTime m = OffsetTime.now(); ValueRange z = m.range(ChronoField.HOUR_OF_DAY); System.out.println(z); } }
The code above generates the following result.