List of utility methods to do LocalDate to Date
Date | toDate(LocalDate ld) to Date if (ld == null) { return null; return Date.from(ld.atStartOfDay(UTC).toInstant()); |
Date | toDate(LocalDate ld) to Date Calendar c = Calendar.getInstance();
c.set(ld.getYear(), ld.getMonthValue() - 1, ld.getDayOfMonth());
Date dateNew = c.getTime();
return dateNew;
|
Date | toDate(LocalDate localDate) to Date return toDate(localDate.atStartOfDay());
|
Date | toDate(LocalDate localDate) to Date if (localDate == null) { return null; Instant instant = localDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant(); Date date = Date.from(instant); return date; |
Date | toDate(LocalDate localDate) to Date Preconditions.checkNotNull(localDate, "localDate should't be null"); return Date.from(localDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()); |
Date | toDate(LocalDate localDate) to Date if (localDate == null) { return null; ZonedDateTime zonedDateTime = localDate.atStartOfDay(DEFAULT_ZONEID); return Date.from(zonedDateTime.toInstant()); |
Date | toDate(LocalDate localDate) to Date Instant instant = localDate.atStartOfDay().toInstant(ZoneOffset.of("+0")); return Date.from(instant); |
Date | toUtilDate(LocalDate localDate) to Util Date if (localDate == null) { return null; return toUtilDate(localDate.atTime(0, 0, 0, 0)); |