Here you can find the source of convertUnixTimeStampToMySql(long timestamp)
public static String convertUnixTimeStampToMySql(long timestamp)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String convertUnixTimeStampToMySql(long timestamp) { Date date = new Date(timestamp * 1000L); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String formattedDate = ""; try {/* w w w.j a v a2s. co m*/ formattedDate = sdf.format(date); } catch (Exception E) { E.printStackTrace(); } return formattedDate; } }