Here you can find the source of getCurTime()
public static Timestamp getCurTime()
//package com.java2s; import java.sql.Timestamp; import java.util.Calendar; public class Main { /**/*from ww w . j a v a 2s. c o m*/ * get current time * * @return Timestamp */ public static Timestamp getCurTime() { return new Timestamp(Calendar.getInstance().getTime().getTime()); } public static String getTime() { Timestamp time = new Timestamp(Calendar.getInstance().getTime().getTime()); return time.toString(); } }