Java examples for java.time:LocalDate
create java.util.Date from LocalDate
//package com.java2s; import java.time.LocalDate; import java.time.Month; import java.time.ZoneId; import java.util.Date; public class Main { public static Date createDate(int year, Month month, int day) { LocalDate localDate = LocalDate.of(year, month, day); return localDateToDate(localDate); }//from w w w .j a v a2s .com public static Date localDateToDate(LocalDate localDate) { return Date.from(localDate.atStartOfDay(ZoneId.systemDefault()) .toInstant()); } }