Java tutorial
//package com.java2s; //License from project: Apache License import java.sql.Date; import java.text.Format; import java.text.SimpleDateFormat; import java.util.Locale; public class Main { /** * Helper method to get the date and time from timestamp. Converts the Timestamp in Milliseconds to Date and Time and then * formats the Date object with {@link Format} and returns the String of Date and Time. * * @return */ public static String getDateAndTime(long timestamp) { Date date = new Date(timestamp); Format dateFormat = new SimpleDateFormat("MM/dd/yy HH:mm:ss", Locale.US); return dateFormat.format(date); } }