Here you can find the source of millisecondToDate(long timeMillis)
public static String millisecondToDate(long timeMillis)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String millisecondToDate(long timeMillis) { if (timeMillis <= 0) return ""; Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(timeMillis); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); return dateFormat.format(calendar.getTime()); }/*from ww w . ja v a2 s . c om*/ }