Here you can find the source of localDateToSystemAdjustedStartOfDayDate(LocalDate d)
Parameter | Description |
---|---|
d | a parameter |
Parameter | Description |
---|---|
Exception | an exception |
public static Date localDateToSystemAdjustedStartOfDayDate(LocalDate d) throws Exception
//package com.java2s; //License from project: Open Source License import java.time.*; import java.util.Date; public class Main { /**//from w w w . ja v a 2s . co m * Adjusts a LocalDate to Midnight of the say day (start of day). * * @param d * @return * @throws Exception */ public static Date localDateToSystemAdjustedStartOfDayDate(LocalDate d) throws Exception { LocalDateTime ldt = d.atStartOfDay(); return getSystemDefaultDate(ldt); } /** * Get local system Date from LocalDateTime * * @param ldt * @return * @throws Exception */ public static Date getSystemDefaultDate(LocalDateTime ldt) throws Exception { return Date.from(ldt.atZone(ZoneId.systemDefault()).toInstant()); } }