Java Utililty Methods Hour Format

List of utility methods to do Hour Format

Description

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

Method

StringformatDateTime(Date d)
format Date Time
return formatDateTime(d, DATETIME_PATTERN);
StringformatDateTime(Date d)
format Date Time
return format(d, DATETIME_FORMAT);
StringformatDateTime(Date d)
format Date Time
DateFormat df = new SimpleDateFormat("hh:mm:ss - dd/MM/yyyy");
Calendar c = Calendar.getInstance();
c.setTime(d);
return df.format(c.getTime());
StringformatDateTime(Date date)
format Date Time
return formatDate(date, "EEE, d MMM yyyy HH:mm:ss");
StringformatDateTime(Date date)
format Date Time
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
return sdf.format(date);
StringformatDatetime(Date date)
format Datetime
DateFormat dateFormat = new SimpleDateFormat(DATE_TIME_FORMAT);
return dateFormat.format(date);
StringformatDateTime(Date date)
Formats a date time
if (date == null) {
    return "";
return dateFormatter.format(date) + " " + timeFormatter.format(date);
StringformatDateTime(Date date)
format Date Time
return formatTime(date) + ' ' + formatDate(date);
StringformatDateTime(Date date)
format Date Time
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return dateFormat.format(date);
StringformatDateTime(Date date)
Format the Date object to string with format "yyyy-MM-dd HH:mm:ss"
if (date != null) {
    synchronized (SDF_DETAIL) {
        return SDF_DETAIL.format(date);
} else {
    return null;