Here you can find the source of getSeconds2()
public static String getSeconds2()
//package com.java2s; import java.sql.Timestamp; public class Main { public static String getSeconds2() { java.util.Date date1 = new java.util.Date(); Timestamp stamp2 = new Timestamp(date1.getTime()); return stamp2.toString(); }/*from w w w . ja v a 2s . co m*/ }