Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getStringTime(long timestamp, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); String result = sdf.format(new Date(timestamp)); return result; } }