Here you can find the source of calToTimeStamp(Calendar cal)
public static Timestamp calToTimeStamp(Calendar cal)
//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()); } }