Java Date to Time extractTimeFromDate(Date date)

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

Description

extract Time From Date

License

Apache License

Declaration

public static String extractTimeFromDate(Date date) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String extractTimeFromDate(Date date) {

        SimpleDateFormat printFormat = new SimpleDateFormat("HH:mm:ss");
        return printFormat.format(date); // prints 09:30:51

    }/*from   w  w w  .ja  va 2 s. co m*/
}

Related

  1. getFriendlyTime(Date dateTime)
  2. getFriendlyTimeString(Date date)
  3. getMediumDateString(Date date, boolean includeTime)
  4. getMSDateTimeString(Date date)