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

StringformatRuntime(long runtime)
Returns the given runtime formatted as ISO-8601 string.
return decrementDays(runtimeDateFormat.format(new Date(runtime)));
StringformatSDate(java.util.Date date)
Format S date.
if (date == null)
    return "";
else {
    SimpleDateFormat bartDateFormat = new SimpleDateFormat("yyyy-M-d HH:mm:ss");
    return bartDateFormat.format(date);
StringformatShortDate(java.util.Date date)
format Short Date
if (date == null) {
    return "";
return formatter.format(date);
StringformatShortTime()
format Short Time
return HH_mm.format(getCalendar().getTime());
StringformatSimpleTimeAndDateString(Date date)
format Simple Time And Date String
SimpleDateFormat sdf = new SimpleDateFormat(simpleTimeAndDatePattern);
return sdf.format(date);
StringformatSingleFractionHours(Double updatedHours)
public for testing Formats input as single digit fraction string
NumberFormat format = getHoursNumberFormat();
return format.format(updatedHours);
StringformatSQL(Date date)
format SQL
return formatSQL(date, false);
StringformatSqlDateTime(Date value)
format Sql Date Time
return formatDate(value, PATTERN_SQL_DATETIME_FULL, null);
StringformatSSLValid(Date validFrom, Date validTo)
format SSL Valid
DateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH); 
return "from " + df.format(validFrom) + " until " + df.format(validTo); 
StringformatStringTime(String dateTime)
format String Time
if (dateTime == null || dateTime.equals("")) {
    return null;
String formatToUTC = null;
try {
    long parseLong = Long.parseLong(dateTime);
    formatToUTC = formatToUTC(parseLong);
} catch (NumberFormatException e2) {
...