Here you can find the source of getCurrentTime()
public static String getCurrentTime()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Locale; public class Main { public static String getCurrentTime() { Calendar calendar = Calendar.getInstance(Locale.CHINESE); calendar.setTimeInMillis(new Date().getTime()); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss"); return dateFormat.format(calendar.getTime()); }/*from w w w . j a va 2s .co m*/ }