Here you can find the source of formatDateTime(Date date)
Parameter | Description |
---|
public static String formatDateTime(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.*; public class Main { public static final String DATETIME_FORMAT = "dd/MM/yyyy HH:mm:ss"; private static SimpleDateFormat dateTimeFormat; /**/*from w w w .j a v a2 s . c o m*/ * @return the default dateTime format in europe. * @param date: the date to format */ public static String formatDateTime(Date date) { if (dateTimeFormat == null) { dateTimeFormat = new SimpleDateFormat(DATETIME_FORMAT); } return dateTimeFormat.format(date); } }