Java SQL Date Create convertToSqlDate(Calendar calendar)

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

Description

convert To Sql Date

License

Open Source License

Declaration

private static java.sql.Date convertToSqlDate(Calendar calendar) 

Method Source Code

//package com.java2s;
/*//from ww w .  j  a va 2  s. c o m
 * Copyright (c) 2005-2011 Grameen Foundation USA
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * permissions and limitations under the License.
 *
 * See also http://www.apache.org/licenses/LICENSE-2.0.html for an
 * explanation of the license and how it is applied.
 */

import java.util.Calendar;
import java.util.Date;

public class Main {
    private static java.sql.Date convertToSqlDate(Calendar calendar) {
        return new java.sql.Date(calendar.getTimeInMillis());
    }

    public static java.sql.Date convertToSqlDate(Date date) {
        return new java.sql.Date(date.getTime());
    }
}

Related

  1. convertToCalendar(Date date)
  2. convertToDatabaseDate(Date date)
  3. convertToDate(Object o)
  4. convertToMySqlDate(Date date)
  5. convertToSDate(java.util.Date uDate)
  6. convertToSqlDate(java.util.Date argUtilDate)
  7. ConvertToSqlDate(java.util.Date date)
  8. convertToSQLDate(java.util.Date date)
  9. convertToSqlDate(java.util.Date utilDate)