Java tutorial
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { private static final SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); public static String format(long timeInMillis) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(timeInMillis); return timeFormat.format(calendar.getTime()); } }