Here you can find the source of formatDate(Date date)
Parameter | Description |
---|---|
date | the date |
public static String formatDate(Date date)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.util.Date; public class Main { /**/*from ww w .j a v a 2s .co m*/ * Formats a date. * @param date the date in the form of a UNIX timestamp * @return formatted date */ public static String formatDate(Long date) { if (date == null) { return null; } return formatDate(new Date(date)); } /** * Formats a date. * @param date the date * @return formatted date */ public static String formatDate(Date date) { if (date == null) { return null; } return DateFormat.getDateTimeInstance().format(date); } }