Here you can find the source of getCurrentDate(String time)
public static String getCurrentDate(String time)
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Locale; public class Main { public static String getCurrentDate(long time) { DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);//from w w w.jav a 2 s .c om return dateFormat.format(time); } public static String getCurrentDate(String time) { DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA); return dateFormat.format(Long.valueOf(time)); } }