Here you can find the source of formatDate(Date date)
Parameter | Description |
---|---|
date | The date and time. |
public static String formatDate(Date date)
//package com.java2s; /* Please see the license information at the end of this file. */ import java.util.*; import java.text.*; public class Main { /** Date formatter for dates and times in format e.g. 02/06/02 10:32 AM. */ static private final SimpleDateFormat dateFormatter1 = new SimpleDateFormat("MM/dd/yy hh:mm aa"); /** Formats a date and time as (for example) "02/06/02 10:32 AM". */* w w w. j a v a 2 s . c o m*/ * @param date The date and time. * * @return The formatted date and time. */ public static String formatDate(Date date) { return dateFormatter1.format(date); } }