Here you can find the source of getTimeForm(long milliseconds)
public static String getTimeForm(long milliseconds)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static String getTimeForm(long milliseconds) { Calendar c = Calendar.getInstance(); c.setTimeInMillis(milliseconds); StringBuffer sb = new StringBuffer(); sb.append(c.get(Calendar.YEAR)).append("-") .append(c.get(Calendar.MONTH) + 1).append("-") .append(c.get(Calendar.DAY_OF_MONTH)).append(" ") .append(c.get(Calendar.HOUR_OF_DAY)).append(":") .append(c.get(Calendar.MINUTE)); return sb.toString(); }/*w ww . j av a 2s . c o m*/ }