Here you can find the source of formatTime(long localCreationTimeMillis)
public static String formatTime(long localCreationTimeMillis)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static DateFormat m_dateFormatWithMillis = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss.SSS"); private static ThreadLocal<Date> m_dates = new ThreadLocal<Date>(); public static String formatTime(long localCreationTimeMillis) { Date date = getTempDate(); date.setTime(localCreationTimeMillis); return m_dateFormatWithMillis.format(date); }/* ww w. j a v a 2 s . co m*/ private static Date getTempDate() { Date date = m_dates.get(); if (date == null) { date = new Date(); m_dates.set(date); } return date; } }