Here you can find the source of dateFormatted(Date date)
Parameter | Description |
---|---|
date | The date to format. |
public static String dateFormatted(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/*from www .j a v a 2 s .c om*/ * Returns the date with the format yyyy/MM/dd HH:mm:ss. If the parameter is * null, return a empty string. * * @author mgimenez * @param date * The date to format. * @return The String of the date with the format yyyy/MM/dd HH:mm:ss */ public static String dateFormatted(Date date) { String result = ""; if (date != null) { result = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(date); } return result; } }