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