Java SQL LocalDate toDate(LocalDate localDate)

Here you can find the source of toDate(LocalDate localDate)

Description

to Date

License

Apache License

Declaration

public static Date toDate(LocalDate localDate) 

Method Source Code


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

import java.sql.Date;

import java.time.LocalDate;

import java.time.ZoneOffset;

public class Main {
    public static Date toDate(LocalDate localDate) {
        if (localDate == null) {
            return null;
        }//  w w w  .j  ava2  s  .com
        return new Date(Date.from(localDate.atStartOfDay(ZoneOffset.systemDefault()).toInstant()).getTime());
    }
}

Related

  1. getLocalDate()
  2. getLocalDateFromUtilDate(Date input)
  3. getSqlDate(java.util.Date paramDate)
  4. setDate(PreparedStatement s, int col, LocalDate ld)
  5. toDate(LocalDate localDate)
  6. toDate(LocalDate localDate)
  7. toInstant(Date date)
  8. toJavaDate(DateMidnight dm)
  9. toJDBC(LocalDate fecha)