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

Stringformat(Date date)
format
return date == null ? null : getParser().format(date);
Stringformat(Date date)
format
if (date == null) {
    return null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
return sdf.format(date);
Stringformat(Date date)
Format a date object.
return DATE_FORMAT.get().format(date);
Stringformat(Date date)
Formats a Date into a Date-Time value used by SpreadsheetML.
StringBuffer sb = new StringBuffer(getDateFormat().format(date));
sb.append("T");
sb.append(getTimeFormat().format(date));
return sb.toString();
Stringformat(Date date)
format
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(date);
return dateString;
Stringformat(Date date, String dateFormat)
format
if (date != null) {
    SimpleDateFormat format = new SimpleDateFormat(dateFormat);
    String dateString = format.format(date);
    return dateString;
return null;
Stringformat(Date date, String format)
format
SimpleDateFormat df = new SimpleDateFormat(format);
return df.format(date);
Stringformat(Date date, String format)
format
return new SimpleDateFormat(format).format(date);
Stringformat(Date date, String pattern)
format
return date == null ? " " : new SimpleDateFormat(pattern).format(date);
Stringformat(Date date, String ptrn)
Formats passed date with specified pattern.
java.text.DateFormat format = new java.text.SimpleDateFormat(ptrn);
return format.format(date);