Java Date to Timestamp dateToTimestamp(java.util.Date date)

Here you can find the source of dateToTimestamp(java.util.Date date)

Description

Description: Change the java.util.date format to java.sql.Timestamp format

License

Open Source License

Parameter

Parameter Description

Return

java.sql.Timestamp

Declaration

public static Timestamp dateToTimestamp(java.util.Date date) 

Method Source Code


//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());
    }
}

Related

  1. dateToTimestamp(Date date)
  2. dateToTimestamp(Date date)
  3. dateToTimestamp(Date date)
  4. DateToTimestamp(Date time)
  5. dateToTimestamp(java.util.Date d)
  6. dateToTimeStamp(java.util.Date date)
  7. escapeAsTimestamp(Date date)
  8. getAsTimestampOrEmptyString(Date date)
  9. getAuditTimestamp(Date date)