Java tutorial
//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(c.YEAR)).append("-").append(c.get(c.MONTH) + 1).append("-").append(c.get(c.DAY_OF_MONTH)) .append(" ").append(c.get(c.HOUR_OF_DAY)).append(":").append(c.get(c.MINUTE)); return sb.toString(); } }