Here you can find the source of getDateTime(long microsecond)
public static String getDateTime(long microsecond)
//package com.java2s; 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 ww w .java 2 s . c om public static String getFormatDateTime(Date date, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(date); } }