Java Utililty Methods SQL LocalDate

List of utility methods to do SQL LocalDate

Description

The list of methods to do SQL LocalDate are organized into topic(s).

Method

LocalDategetLocalDate()
get Local Date
return getLocalDateTime().toLocalDate();
LocalDategetLocalDateFromUtilDate(Date input)
get Local Date From Util Date
return input.toLocalDate();
java.sql.DategetSqlDate(java.util.Date paramDate)
get Sql Date
java.sql.Date localDate = new java.sql.Date(paramDate.getTime());
return localDate;
voidsetDate(PreparedStatement s, int col, LocalDate ld)
set Date
if (ld == null) {
    s.setNull(col, Types.DATE);
} else {
    s.setDate(col, java.sql.Date.valueOf(ld));
java.sql.DatetoDate(LocalDate localDate)
Convert a LocalDate to a Date.
if (localDate == null)
    return null;
return java.sql.Date.valueOf(localDate);
DatetoDate(LocalDate localDate)
to Date
return Date.valueOf(localDate);
DatetoDate(LocalDate localDate)
to Date
if (localDate == null) {
    return null;
return new Date(Date.from(localDate.atStartOfDay(ZoneOffset.systemDefault()).toInstant()).getTime());
InstanttoInstant(Date date)
to Instant
return date.toLocalDate().atStartOfDay(ZoneOffset.UTC).toInstant();
java.util.DatetoJavaDate(DateMidnight dm)
to Java Date
java.util.Date d = (dm == null ? null : new java.util.Date(dm.getMillis()));
return d;
DatetoJDBC(LocalDate fecha)
Convierte la fecha en el formato de Joda-Time al equivalente en el formato de JDBC java.sql.Date
return fecha == null ? null : new Date(fecha.toDateMidnight().getMillis());