OffsetTime now(Clock clock) example
Description
OffsetTime now(Clock clock)
creates
the current time from the specified clock.
Syntax
now
has the following syntax.
public static OffsetTime now(Clock clock)
Example
The following example shows how to use now
.
import java.time.Clock;
import java.time.OffsetTime;
/* w ww . j a v a2s. com*/
public class Main {
public static void main(String[] args) {
OffsetTime m = OffsetTime.now(Clock.systemUTC());
System.out.println(m);
}
}
The code above generates the following result.