Java SQL Date Create convertSqlUtil(java.util.Date d)

Here you can find the source of convertSqlUtil(java.util.Date d)

Description

convertSqlUtil Realiza la conversion un java.util.Date a java.sql.Date

License

Apache License

Parameter

Parameter Description
d java.util.Date

Return

java.util.Date

Declaration

public static java.sql.Date convertSqlUtil(java.util.Date d) 

Method Source Code

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

public class Main {
    /**//from ww w.ja v a  2  s  .co m
     * convertSqlUtil Realiza la conversion un java.util.Date a java.sql.Date
     *
     * @param d java.util.Date
     *
     * @return java.util.Date
     */
    public static java.sql.Date convertSqlUtil(java.util.Date d) {
        java.sql.Date res = new java.sql.Date(
                new java.util.Date().getTime());

        if (d != null) {
            res = new java.sql.Date(d.getTime());
        }

        return res;
    }
}

Related

  1. converToDate(String yyyy, String mm, String dd)
  2. convertSqlDate(java.util.Date date)
  3. convertSqlDate2Calendar(java.sql.Date date)
  4. convertSqlDateToJavaDate(java.sql.Date sqlDate)
  5. convertSQLDateToUtilDate(java.sql.Date date)
  6. convertStringToSql(final String dateStr)
  7. convertToCalendar(Date date)
  8. convertToDatabaseDate(Date date)
  9. convertToDate(Object o)