Here you can find the source of formatDate(Date date)
Parameter | Description |
---|
public static String formatDate(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.*; public class Main { public static final String DATE_FORMAT = "dd/MM/yyyy"; private static SimpleDateFormat dateFormat; /**// w ww.j a v a 2 s.c o m * @return the default date format in europe. * @param date: the date to format */ public static String formatDate(Date date) { checkDateFormat(); return dateFormat.format(date); } private static void checkDateFormat() { if (dateFormat == null) { dateFormat = new SimpleDateFormat(DATE_FORMAT); } } }