Java Hour Format formatTime(Date date)

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

Description

format Time

License

Apache License

Declaration

public static String formatTime(Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Date;

public class Main {

    public static String formatTime(Date date) {
        return formatTime(null, date);
    }/* w  ww  .  j  a  v  a  2  s. c o  m*/

    public static String formatTime(String format, Date date) {
        if (format == null) {
            format = "yyyy-MM-dd HH:mm:ss";
        }

        String time = new java.text.SimpleDateFormat(format).format(date);
        return time;
    }
}

Related

  1. formatterDate(Date date, byte format)
  2. formatterFor(final Thread t)
  3. formatTime(Date d)
  4. formatTime(Date d)
  5. formatTime(Date date)
  6. formatTime(Date date)
  7. formatTime(Date date)
  8. formatTime(Date date)
  9. formatTime(Date date)