Here you can find the source of parseStringToDatePrettyPrint(Date date)
Date
object into a String
object for pretty printing.
Parameter | Description |
---|---|
date | a <code>Date</code> object to be converted |
Parameter | Description |
---|---|
ParseException | an exception |
String
object converted
public static String parseStringToDatePrettyPrint(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { static final private SimpleDateFormat pretty_format = new SimpleDateFormat("mm/dd/yyyy 'at' HH:mm a z"); /**/*from ww w . ja va 2 s. com*/ * Converts a <code>Date</code> object into a <code>String</code> object for pretty printing. * * @param date a <code>Date</code> object to be converted * @return a <code>String</code> object converted * @throws ParseException */ public static String parseStringToDatePrettyPrint(Date date) { return pretty_format.format(date); } }