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