Here you can find the source of getDateTime(long microsecond)
public static String getDateTime(long microsecond)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getDateTime(long microsecond) { return getFormatDateTime(new Date(microsecond), "yyyy-MM-dd HH:mm:ss"); }/*from www . ja va 2s .c om*/ public static String getFormatDateTime(Date date, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(date); } }