Java tutorial
import java.sql.Timestamp; import java.util.Date; public class Main { public static void main(String[] args) throws Exception { Date date = new Date(); System.out.println("Format To times:"); System.out.println(date.getTime()); Timestamp ts = new Timestamp(date.getTime()); System.out.println(ts); } }