Here you can find the source of changeMillisToFormat(long milliseconds, String pattern)
public static String changeMillisToFormat(long milliseconds, String pattern)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String changeMillisToFormat(long milliseconds, String pattern) {//from w ww. j a v a2 s .c om Date fecha = new Date(milliseconds); return changeDateToFormatString(fecha, pattern); } public static String changeDateToFormatString(Date fecha, String pattern) { DateFormat formato = new SimpleDateFormat(pattern); return formato.format(fecha); } }