Java Date to LocalDateTime toLocalDateTime(Date date)

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

Description

to Local Date Time

License

Open Source License

Declaration

public static LocalDateTime toLocalDateTime(Date date) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.time.Instant;

import java.time.LocalDateTime;
import java.time.ZoneId;

import java.util.Date;

public class Main {
    public static final ZoneId DEFAULT_ZONEID = ZoneId.systemDefault();

    public static LocalDateTime toLocalDateTime(Date date) {
        return LocalDateTime.ofInstant(Instant.ofEpochMilli(date.getTime()), DEFAULT_ZONEID);
    }//from   ww w  .  j  av a 2 s.c om
}

Related

  1. toLocalDateTime(BigDecimal comTime)
  2. toLocalDateTime(Date date)
  3. toLocalDateTime(Date date)
  4. toLocalDateTime(Date dateTime)
  5. toLocalDateTime(Date utilDate)
  6. toLocalDateTime(long timestamp)
  7. toLocalDateTime(String date, int time)