Here you can find the source of nowAsTimestamp()
public static Timestamp nowAsTimestamp()
//package com.java2s; import java.sql.Timestamp; import java.util.Calendar; public class Main { public static Timestamp nowAsTimestamp() { Calendar objCurrentCalendar = Calendar.getInstance(); return new Timestamp(objCurrentCalendar.getTimeInMillis()); }// w ww. j av a2 s. co m }