Here you can find the source of currentTime()
public static String currentTime()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static SimpleDateFormat seconParse = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static String currentTime() { Date date = new Date(); return seconParse.format(date); }//from w w w .j av a 2s . c o m }