Java SQL LocalDate toSQLDate(DateMidnight dm)

Here you can find the source of toSQLDate(DateMidnight dm)

Description

to SQL Date

License

Apache License

Declaration

public static java.sql.Date toSQLDate(DateMidnight dm) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import org.joda.time.DateMidnight;

import org.joda.time.LocalDate;

public class Main {
    public static java.sql.Date toSQLDate(DateMidnight dm) {
        // TODO - confirm this conversion always works, esp. across timezones
        java.sql.Date d = (dm == null ? null : new java.sql.Date(dm.getMillis()));
        return d;
    }/* ww w  .ja  v a2s  . c om*/

    public static java.sql.Date toSQLDate(LocalDate ld) {
        // TODO - confirm this conversion always works, esp. across timezones
        java.sql.Date d = (ld == null ? null : new java.sql.Date(ld.toDateTimeAtStartOfDay().getMillis()));
        return d;
    }
}

Related

  1. toLocalDate(Date date)
  2. toLocalDate(final Date d)
  3. toLocalDate(java.sql.Date date)
  4. toLocalDate(java.util.Date d)
  5. toSqlDate(Date d)
  6. toSqlDate(LocalDate ld)
  7. toSqlDateNoInicio(LocalDate data)
  8. transfer(java.util.Date date)