Java Date Time - ZonedDateTime toLocalDateTime() example

ZonedDateTime toLocalDateTime() gets the LocalDateTime part of this date-time.


toLocalDateTime has the following syntax.

public LocalDateTime toLocalDateTime()


The following example shows how to use toLocalDateTime.

import java.time.LocalDateTime;
import java.time.ZonedDateTime;
/*  ww w  . j  a v a2s.c  om*/
public class Main {
  public static void main(String[] args) {
    ZonedDateTime dateTime;
    LocalDateTime l = dateTime.toLocalDateTime();

The code above generates the following result.