ZonedDateTime toLocalDateTime() example
Description
ZonedDateTime toLocalDateTime()
gets the LocalDateTime part of this date-time.
Syntax
toLocalDateTime
has the following syntax.
public LocalDateTime toLocalDateTime()
Example
The following example shows how to use toLocalDateTime
.
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
// www . j a va2 s .com
public class Main {
public static void main(String[] args) {
ZonedDateTime dateTime =ZonedDateTime.now();
LocalDateTime l = dateTime.toLocalDateTime();
System.out.println(l);
}
}
The code above generates the following result.