Java Timestamp calendarToTimestamp(java.util.Calendar inCal)

Here you can find the source of calendarToTimestamp(java.util.Calendar inCal)

Description

Returns Timestamp converted from Calendar.

License

Open Source License

Parameter

Parameter Description
inCal Source calendar which to be converted.

Return

Timestamp object which converted from input.

Declaration

public static java.sql.Timestamp calendarToTimestamp(java.util.Calendar inCal) 

Method Source Code

//package com.java2s;
/*/*w  w w.j ava 2s  . c o m*/
* @(#)Utility.java
*
* Copyright (c) 2003 DCIVision Ltd
* All rights reserved.
*
* This software is the confidential and proprietary information of DCIVision
* Ltd ("Confidential Information").  You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the license
* agreement you entered into with DCIVision Ltd.
 */

public class Main {
    /**
     * Returns Timestamp converted from Calendar.
     *
     * @param   inCal Source calendar which to be converted.
     * @return  Timestamp object which converted from input.
     */
    public static java.sql.Timestamp calendarToTimestamp(java.util.Calendar inCal) {
        if (inCal == null) {
            return (null);
        }
        java.sql.Timestamp time = new java.sql.Timestamp(inCal.getTime().getTime());
        return (time);
    }
}

Related

  1. argMapTimestamp(Map argMap, Map argMapNotUsed, String key)
  2. beforeTimestamp2Safety(Timestamp ts1, Timestamp ts2)
  3. between(Timestamp t1, Timestamp t2)
  4. calcRealTime(Timestamp beginTime, Timestamp endTime)
  5. calendar2Timestamp(Calendar c)
  6. calToTimeStamp(Calendar cal)
  7. changeDate(Timestamp date, Integer amount, Integer unit)
  8. checkTimestamp(String sval)
  9. clone(Timestamp original)