Java Timestamp calToTimeStamp(Calendar cal)

Here you can find the source of calToTimeStamp(Calendar cal)

Description

cal To Time Stamp

License

Apache License

Declaration

public static Timestamp calToTimeStamp(Calendar cal) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.Timestamp;

import java.util.Calendar;

public class Main {

    public static Timestamp calToTimeStamp(Calendar cal) {
        Timestamp tm = null;/*from w w  w  . ja  va  2s.co m*/
        if (cal == null) {
            tm = null;
        } else {
            tm = new Timestamp(cal.getTime().getTime());
        }

        return tm;
        // return (cal == null) ? null : new
        // Timestamp(cal.getTime().getTime());
    }
}

Related

  1. beforeTimestamp2Safety(Timestamp ts1, Timestamp ts2)
  2. between(Timestamp t1, Timestamp t2)
  3. calcRealTime(Timestamp beginTime, Timestamp endTime)
  4. calendar2Timestamp(Calendar c)
  5. calendarToTimestamp(java.util.Calendar inCal)
  6. changeDate(Timestamp date, Integer amount, Integer unit)
  7. checkTimestamp(String sval)
  8. clone(Timestamp original)
  9. concatDateAndTime(Timestamp date, Time time)