Here you can find the source of formatDate(long d)
public static String formatDate(long d)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; public class Main { public static String DATE_FORMAT = "yyyy-MM-dd"; /**/* w ww. j a v a2 s .c om*/ * Convert date to String like "yyyy-MM-dd". */ public static String formatDate(long d) { return new SimpleDateFormat(DATE_FORMAT).format(d); } }