Here you can find the source of formatDateTime(long millis)
public static String formatDateTime(long millis)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static SimpleDateFormat datetime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static String formatDateTime(long millis) { Date resultdate = new Date(millis); return datetime.format(resultdate); }/*w w w .ja v a2s . c o m*/ }