Here you can find the source of format(Long dateMs, String type)
public static String format(Long dateMs, String type)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String format(Date aDate, String type) { SimpleDateFormat sdf = new SimpleDateFormat(type); return sdf.format(aDate); }/* ww w.j a v a 2 s.c om*/ public static String format(Long dateMs, String type) { Date date = new Date(dateMs); SimpleDateFormat sdf = new SimpleDateFormat(type); return sdf.format(date); } }