OffsetTime query(TemporalQuery<R> query)
queries this time using the specified query.
query
has the following syntax.
public <R> R query(TemporalQuery<R> query)
The following example shows how to use query
.
import java.time.OffsetTime; import java.time.ZoneOffset; import java.time.temporal.TemporalQueries; /*from w ww. j a v a2 s.c o m*/ public class Main { public static void main(String[] args) { OffsetTime m = OffsetTime.now(); ZoneOffset n = m.query(TemporalQueries.offset()); System.out.println(n); } }
The code above generates the following result.