Java Hour Format formatDateTime(Date date)

Here you can find the source of formatDateTime(Date date)

Description

format Date Time

License

Apache License

Parameter

Parameter Description

Return

the default dateTime format in europe.

Declaration

public static String formatDateTime(Date date) 

Method Source Code

//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);
    }
}

Related

  1. formatDatetime(Date date)
  2. formatDateTime(Date date)
  3. formatDateTime(Date date)
  4. formatDateTime(Date date)
  5. formatDateTime(Date date)
  6. formatDateTime(Date date)
  7. formatDateTime(Date date)
  8. formatDateTime(Date date)
  9. formatDateTime(Date date)