Java Utililty Methods Date Format

List of utility methods to do Date Format

Description

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

Method

StringformatDate(Date date)
format Date
return dateSdf.format(date);
StringformatDate(Date date)
format Date
dateFormat.applyPattern(DATETIME_PATTERN);
return dateFormat.format(date);
StringformatDate(Date date)
format Date
if (date == null) {
    return "";
return new SimpleDateFormat(DATE_TIME_FORMAT).format(date);
DateformatDate(Date date)
format Date
return parse(format(date), "yyyy-MM-dd");
StringformatDate(Date date)
format Date
return formatDateByFormat(date, "yyyy-MM-dd");
StringformatDate(Date date)
format Date
synchronized (OSU_DATE_FORMAT) {
    return OSU_DATE_FORMAT.format(date);
StringformatDate(Date date)

Formats the given date.

if (date == null) {
    throw new IllegalArgumentException("You must provide a date.");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss'Z'");
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
return dateFormat.format(date);
StringformatDate(Date date)
format Date
return formatDate(date, DEFAULT_DATE_PATTERN);
StringformatDate(Date date)
format Date
return formatDate(date, "yyyy-MM-dd");
StringformatDate(Date date)
Formats a date.
return df.format(date);