Java Date to Time toTime(Date... date)

Here you can find the source of toTime(Date... date)

Description

to Time

License

Open Source License

Declaration


public static String toTime(Date... date) 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    private static final String FORMAT_2 = "HH:mm:ss";

    public static String toTime(Date... date) {

        SimpleDateFormat simple = new SimpleDateFormat(FORMAT_2);

        if (date.length > 0) {

            return simple.format(date[0]);

        }/*  w ww  .  j a  v  a 2  s.  c  o  m*/

        return simple.format(new Date());

    }
}

Related

  1. toGeneralizedTime(Date date)
  2. toLocalDateTime(Date date)
  3. toLocalTimeString(Date d)
  4. toMT4TimeString(Date date)
  5. toSimpleDateTime(Date date)
  6. toTimeStr(Date date)
  7. ToTimeStr(Date dt)
  8. toTimeString(Date date)
  9. toTimeString(Date date)