Here you can find the source of getCurrentDate(long time)
public static String getCurrentDate(long 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 a2 s.co m 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)); } }