Java examples for java.time:LocalDateTime
LocalDateTime To java.sql.Date
//package com.java2s; import java.time.LocalDateTime; import java.time.ZoneId; public class Main { public static java.sql.Date localTimeToDate(LocalDateTime lt) { return new java.sql.Date(lt.atZone(ZoneId.systemDefault()) .toInstant().toEpochMilli()); }/*from ww w .j a v a 2 s. co m*/ }