Java LocalDateTime from dateToLocalDateTime(Date date)

Here you can find the source of dateToLocalDateTime(Date date)

Description

date To Local Date Time

License

Apache License

Declaration

public static ZonedDateTime dateToLocalDateTime(Date date) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.time.Instant;

import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.Date;

public class Main {
    public static ZonedDateTime dateToLocalDateTime(Date date) {
        Instant endDateInstant = Instant.ofEpochMilli(date.getTime());
        return ZonedDateTime.ofInstant(endDateInstant, ZoneOffset.UTC);
    }//from  ww w. j  a v  a2  s  .c o m
}

Related

  1. convertToLocalDateTime(String time)
  2. convertToSystemTime(LocalDateTime userInput, ZoneId userZoneId)
  3. dateToLong(LocalDateTime date)
  4. localDateTimeFromDate(Date date)