Java Hour Format formatDateTime(Date date)

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

Description

format Date Time

License

Open Source License

Declaration

public static String formatDateTime(Date date) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    private static SimpleDateFormat SDF_DATE = new SimpleDateFormat("dd-MM-yyyy");
    private static SimpleDateFormat SDF_TIME = new SimpleDateFormat("HH:mm:ss");

    public static String formatDateTime(Date date) {
        return formatTime(date) + ' ' + formatDate(date);
    }//from w  ww .  j  a  v  a  2  s . c o m

    public static String formatTime(Date date) {
        return SDF_TIME.format(date);
    }

    public static String formatDate(Date date) {
        return SDF_DATE.format(date);
    }
}

Related

  1. formatDateTime(Date d)
  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)