Here you can find the source of getTimeByMillis(long now)
public static String getTimeByMillis(long now) throws ParseException
//package com.java2s; import java.text.*; import java.util.*; public class Main { public static String getTimeByMillis(long now) throws ParseException { DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(now);/*www. jav a2 s . c om*/ return formatter.format(calendar.getTimeInMillis()); } }