Java tutorial
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { /** * Convert milliseconds to "yyyy-MM-dd" format string. * * @param milliseconds Milliseconds. * @return Formated string. */ public final static String convertDate(long milliseconds) { Date date = new Date(milliseconds); SimpleDateFormat dateFormate = new SimpleDateFormat("yyyy-MM-dd"); return dateFormate.format(date); } }