Java SQL Date From toSqlDate(Calendar calendar)

Here you can find the source of toSqlDate(Calendar calendar)

Description

to Sql Date

License

Apache License

Declaration

public static java.sql.Date toSqlDate(Calendar calendar) 

Method Source Code

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

import java.util.Calendar;

public class Main {
    public static java.sql.Date toSqlDate(Calendar calendar) {
        if (calendar == null) {
            return null;
        }/*  w w w.j av a 2s  .c  o  m*/
        return new java.sql.Date(calendar.getTimeInMillis());
    }

    public static java.sql.Date toSqlDate(java.util.Date date) {
        if (date == null) {
            return null;
        }
        return new java.sql.Date(date.getTime());
    }
}

Related

  1. toDate(String dateString)
  2. toDate(String s)
  3. toDateFromString(String str)
  4. toDateMidnight(java.util.Date d)
  5. toDateStr(java.util.Date d)
  6. toSqlDate(Date date)
  7. toSqlDate(Date date)
  8. toSqlDate(Date date)
  9. toSqlDate(Date dt)