Here you can find the source of getNowTime()
public static String getNowTime()
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; public class Main { public static String getNowTime() { // return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); return new Timestamp(System.currentTimeMillis()).toString(); }//from w w w. j a v a 2 s .c om }