Here you can find the source of toReadableTime(Long timestamp, String format)
public static String toReadableTime(Long timestamp, String format)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static String toReadableTime(Long timestamp, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); sdf.setTimeZone(TimeZone.getDefault()); if (timestamp == null) timestamp = System.currentTimeMillis(); return sdf.format(new Date(timestamp)); }/*from w w w. j a v a 2 s .com*/ }