Here you can find the source of dateToSqlDate(Date date)
Parameter | Description |
---|---|
date | Date |
public static java.sql.Date dateToSqlDate(Date date)
//package com.java2s; /**/*w ww . j a v a 2s . c o m*/ * Copyright 2010 ZTEsoft Inc. All Rights Reserved. * * This software is the proprietary information of ZTEsoft Inc. * Use is subject to license terms. * * $Tracker List * * $TaskId: $ $Date: 9:24:36 AM (May 9, 2008) $comments: create * $TaskId: $ $Date: 3:56:36 PM (SEP 13, 2010) $comments: upgrade jvm to jvm1.5 * * */ import java.util.Date; public class Main { /** * Date to SqlDate * * @param date * Date * @return Date */ public static java.sql.Date dateToSqlDate(Date date) { if (date == null) { return null; } else if (date instanceof java.sql.Date) { return (java.sql.Date) date; } else { return new java.sql.Date(date.getTime()); } } }