Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { /** * Formats the passed milliseconds to the defined pattern * * @param pattern time/date pattern * @param milliSeconds milliseconds * @return formatted time/date */ public static String getFormattedDate(String pattern, long milliSeconds) { return new SimpleDateFormat(pattern, Locale.ENGLISH).format(new Date(milliSeconds)); } }