Here you can find the source of time2DATETIME(long time)
public static String time2DATETIME(long time)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String time2DATETIME(long time) { SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date d = new Date(time); return "\"" + fmt.format(d) + "\""; }//w w w . j a v a 2s.c o m }