Here you can find the source of formatDate(Long date)
Parameter | Description |
---|---|
date | the date in the form of a UNIX timestamp |
public static String formatDate(Long date)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.util.Date; public class Main { /**/*w w w . j a va 2 s .c om*/ * 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); } }