Java SQL LocalDate toLocalDate(java.sql.Date date)

Here you can find the source of toLocalDate(java.sql.Date date)

Description

Converts java.sql.Date to LocalDate (null safety)

License

Apache License

Parameter

Parameter Description

Return

LocalDate

Declaration

public static LocalDate toLocalDate(java.sql.Date date) 

Method Source Code

//package com.java2s;
/*// w w w . j  a  v a 2s.com
 * JEF - Copyright 2009-2010 Jiyi (mr.jiyi@gmail.com)
 *
 * 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.
 */

import java.time.LocalDate;

public class Main {
    /**
     * Converts java.sql.Date to LocalDate (null safety)
     * @param java.sql.Date
     * @return LocalDate
     */
    public static LocalDate toLocalDate(java.sql.Date date) {
        return date == null ? null : date.toLocalDate();
    }
}

Related

  1. toJavaDate(DateMidnight dm)
  2. toJDBC(LocalDate fecha)
  3. toLocalDate(Date date)
  4. toLocalDate(Date date)
  5. toLocalDate(final Date d)
  6. toLocalDate(java.util.Date d)
  7. toSqlDate(Date d)
  8. toSQLDate(DateMidnight dm)
  9. toSqlDate(LocalDate ld)