Java Time Format getTimeFormat(java.util.Date date)

Here you can find the source of getTimeFormat(java.util.Date date)

Description

get Time Format

License

Open Source License

Declaration

public static String getTimeFormat(java.util.Date date) 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;

public class Main {
    /** The time format string:(HH:mm:ss) */
    public static final String TIME_FORMAT_STR = "HH:mm:ss";

    public static String getTimeFormat(java.util.Date date) {
        return getFormat(date, TIME_FORMAT_STR);
    }/* w ww  . jav a2 s  . com*/

    public static String getFormat(java.util.Date date, String parseFormat) {
        if (null == date) {
            return null;
        }
        if (null == parseFormat || "".equalsIgnoreCase(parseFormat)) {
            return date.toString();
        }
        return new SimpleDateFormat(parseFormat).format(date);
    }
}

Related

  1. getTimeCount(String from, String to, String format)
  2. getTimeFormat()
  3. getTimeFormat()
  4. getTimeFormat()
  5. getTimeFormat(Date date, String strFormat)
  6. getTimeFormat(Locale locale)
  7. getTimeFormat(String format)
  8. getTimeFormatted()
  9. getTimeFormatter()