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