Here you can find the source of formatDate(Date d)
public static String formatDate(Date d)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.*; public class Main { public static String formatDate(Date d) { DateFormat df = new SimpleDateFormat("dd/MM/yyyy"); return df.format(d); }// w w w. j a va2s . c om }