Here you can find the source of formatTime(Date date)
Parameter | Description |
---|---|
date | <code>Date</code> to be formatted. |
public static String formatTime(Date date)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/* ww w .jav a 2 s. c om*/ * Formats the given date in the format of "hh:mm:ss.SSSS". * * @param date <code>Date</code> to be formatted. * @return formatted date or null if parameter is null. */ public static String formatTime(Date date) { if (date != null) { return (new SimpleDateFormat("hh:mm:ss.SSSS")).format(date); } return null; } }