Java Utililty Methods Date to String

List of utility methods to do Date to String

Description

The list of methods to do Date to String are organized into topic(s).

Method

StringdateToString(Date date)
convert a date to a string using the standard web service pattern yyyy/MM/dd HH:mm:ss.SSS Note that HH is 0-23
if (date == null) {
    return null;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(WS_DATE_FORMAT);
return simpleDateFormat.format(date);
StringdateToString(Date date)
date To String
System.out.println(date);
return new SimpleDateFormat(fromatType).format(date);
StringdateToString(Date date)
date To String
return (new SimpleDateFormat(FORMAT_PATTERN, LOCAL_ES)).format(date);
StringdateToString(Date date)
date To String
return ("" + DateFormat.getDateInstance(DateFormat.SHORT).format(date));
StringdateToString(Date date)
date To String
return dateformat.format(date);
StringdateToString(Date date)
date To String
return dateToString(date, YYYY_MM_DD_HH_MM_SS, TimeZone.getDefault());
StringdateToString(Date date)
date To String
return df.format(date);
StringdateToString(Date date)
Converts a Date to a String with format DateUtils.DATE_FORMAT.
return date == null ? null : DATE_FORMAT.format(date);
StringdateToString(Date date)
date To String
String dateString = null;
if (date != null) {
    dateString = longDateFormat.format(date);
return dateString;
StringdateToString(Date date)
Convert a date object to string.
SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT);
return formatter.format(date);