Here you can find the source of getCurrentTimeStr()
public static String getCurrentTimeStr()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { private final static SimpleDateFormat dateFormater = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss", Locale.CHINA); public static String getCurrentTimeStr() { return getTimeStr(System.currentTimeMillis()); }//from w w w .j a va2 s . c o m public static String getTimeStr(long time) { return dateFormater.format(new Date(time)); } }