Here you can find the source of convertToDate(LocalDate localDate)
Parameter | Description |
---|---|
localDate | the LocalDate to convert |
static Date convertToDate(LocalDate localDate)
//package com.java2s; //License from project: Creative Commons License import java.time.LocalDate; import java.time.ZoneId; import java.util.Date; public class Main { /**/* ww w . j a va 2 s . c om*/ * @param localDate * the {@link LocalDate} to convert * @return a {@link Date} version of the specified {@link LocalDate} */ static Date convertToDate(LocalDate localDate) { /* * We use the system TZ here to ensure that the date doesn't shift at all, as * FHIR will just use this as an unzoned Date (I think, and if not, it's almost * certainly using the same TZ as this system). */ return Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); } }