Java Date to Time getTime(Date date)

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

Description

get Time

License

Open Source License

Declaration

public static String getTime(Date date) 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class Main {
    private static final String TIME_FORMAT = "HH:mm:ss";
    private static SimpleDateFormat sFormat;

    public static String getTime(Date date) {
        sFormat = new SimpleDateFormat(TIME_FORMAT, Locale.CHINA);
        return sFormat.format(date);
    }//from w  ww  .j  av a  2 s .  c om

    public static String getTime() {
        return getTime(new Date());
    }
}

Related

  1. getMSDateTimeString(Date date)
  2. getTime(Date date)
  3. getTime(Date date)
  4. getTime(Date date)
  5. getTime(Date date)
  6. getTime(Date date)
  7. getTime(Date date)
  8. getTime(Date date)
  9. getTime(Date date, boolean isEnd)