Here you can find the source of formatDate(long ms)
public static synchronized String formatDate(long ms)
//package com.java2s; /*/* ww w . j a va 2 s . c o m*/ * Copyright (C) ${year} Omry Yadan <${email}> * All rights reserved. * * See https://github.com/omry/banana/blob/master/BSD-LICENSE for licensing information */ import java.text.SimpleDateFormat; import java.util.*; public class Main { static SimpleDateFormat s_df; public static synchronized String formatDate(long ms) { return formatDate(new Date(ms)); } public static synchronized String formatDate(Date d) { if (s_df == null) s_df = new SimpleDateFormat("dd MMM yyyy HH:mm:ss zzz"); return s_df.format(d); } }