Here you can find the source of formatDate(Date date)
Parameter | Description |
---|---|
date | the date to be formatted |
private static String formatDate(Date date)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**//from w w w. j av a 2 s . co m * Represents date format to convert Date instance into String representation. */ private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; /** * Converts the given Date instance to string. * @param date the date to be formatted * @return the formatted date (not null) */ private static String formatDate(Date date) { return (new SimpleDateFormat(DATE_FORMAT)).format(date); } }