Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { static String getFormatTime(long timestamp) { try { Date e = new Date(timestamp); SimpleDateFormat localSimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US); String result = localSimpleDateFormat.format(e); return result; } catch (Exception var5) { return ""; } } }