java.sql.Date To LocalDateTime - Java java.time

Java examples for java.time:LocalDateTime

Description

java.sql.Date To LocalDateTime

Demo Code


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

public class Main{
    public static LocalDateTime dateToLocalTime(java.sql.Date d) {
        return LocalDateTime.ofInstant(d, ZoneId.systemDefault());
    }/*from  w  w  w.j av  a2  s .co  m*/
}

Related Tutorials