This example shows how to format time using Format class. In this program we use a pattern of special characters to time format.
Time Format Example
This example shows how to format time using Format class. In this program we use a pattern of special characters to time format.
Description of the code :
SimpleDateFormat() : SimpleDateFormat class use for formatting and parsing dates. It allows for formatting date into text , parsing text into date and normalization.
format() : This method used for format Date class object into date / time and appends the it into the StringBuffer.
TimeFormat.java
|
Output
hh:mm:ss a formate : 04:31:16 PM |