localDate To java.util.Date - Java java.time

Java examples for java.time:LocalDate

Description

localDate To java.util.Date

Demo Code


//package com.java2s;
import java.time.LocalDate;

import java.time.ZoneId;
import java.util.Date;

public class Main {
    public static Date localDateToDate(LocalDate localDate) {
        return Date.from(localDate.atStartOfDay(ZoneId.systemDefault())
                .toInstant());/*w  w w.  j a  va2s  .  co  m*/
    }
}

Related Tutorials