Java SQL Date Create asSqlDate(Date date)

Here you can find the source of asSqlDate(Date date)

Description

Converts the given Date to a java.sql.Date .

License

Open Source License

Parameter

Parameter Description
date the date to convert.

Return

a date.

Declaration

public static java.sql.Date asSqlDate(Date date) 

Method Source Code

//package com.java2s;

import java.util.Date;

public class Main {
    /**//from   w w w  .  j a  v a 2 s .  c o  m
     * Converts the given {@link Date} to a {@link java.sql.Date}.
     *
     * @param date the date to convert.
     * @return a date.
     */
    public static java.sql.Date asSqlDate(Date date) {
        return new java.sql.Date(date.getTime());
    }
}

Related

  1. asDate(java.sql.Date sqlDate)
  2. asDate(Object tsObj)
  3. asSqlDate(Date date)
  4. asSqlDate(String date)
  5. beforeNow(final Date d)
  6. beginOfDay(Date date)
  7. castToSqlDate(Object value)