OffsetTime from(TemporalAccessor temporal)
creates an instance of OffsetTime from a temporal object.
from
has the following syntax.
public static OffsetTime from(TemporalAccessor temporal)
The following example shows how to use from
.
import java.time.OffsetTime; import java.time.ZonedDateTime; //from www . j a v a2s. c o m public class Main { public static void main(String[] args) { OffsetTime m = OffsetTime.from(ZonedDateTime.now()); System.out.println(m); } }
The code above generates the following result.