Java Date to Time getTime(java.util.Date date)

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

Description

get Time

License

Open Source License

Parameter

Parameter Description
date a parameter

Declaration

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

Method Source Code

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

public class Main {

    public static String getTime(java.util.Date date) {
        return format(date, "HH:mm:ss");
    }/*from w w  w. j  a v a 2s.co m*/

    public static String format(java.util.Date date, String format) {
        String result = "";
        try {
            if (date != null) {
                java.text.DateFormat df = new java.text.SimpleDateFormat(format);
                result = df.format(date);
            }
        } catch (Exception e) {
        }
        return result;
    }
}

Related

  1. getTime(Date trialTime)
  2. getTime(final Date date, final int day)
  3. getTime(final Date time)
  4. getTime(java.util.Date date)
  5. getTime(java.util.Date date)
  6. getTimeAsMilliSeconds(Date dateTime)
  7. getTimeAsString(Date date)
  8. getTimeAsXsdDateTime(Date d)
  9. getTimeBackInMillis(final int granularity, final int numberToBack, final Date date)