Here you can find the source of dateToTimestamp(java.util.Date date)
Description: Change the java.util.date format to java.sql.Timestamp format
Parameter | Description |
---|
public static Timestamp dateToTimestamp(java.util.Date date)
//package com.java2s; /*// w w w .j a v a 2 s. c o m * $RCSfile: DatetimeUtil,v $$ * $Revision: 1.0 $ * $Date: 2011 $ * * Copyright (C) 2011 GyTech, Inc. All rights reserved. * * This software is the proprietary information of GyTech, Inc. * Use is subject to license terms. */ import java.sql.Timestamp; public class Main { /** *<p>Description: Change the java.util.date format to java.sql.Timestamp format</p> * @param java.util.Date date * @return java.sql.Timestamp */ public static Timestamp dateToTimestamp(java.util.Date date) { return new Timestamp(date.getTime()); } }