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

StringformatWithSql92Date(Date date)
format With Sql Date
if (date != null) {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh : mm : ss");
    return "{ts '" + sdf.format(date) + "'}";
} else {
    return "NULL";
StringformatXEP0082Date(Date date)
Formats a Date into a XEP-0082 - XMPP Date and Time Profiles string.
synchronized (XEP_0082_UTC_FORMAT) {
    return XEP_0082_UTC_FORMAT.format(date);
StringformatXsdDate(final Date date)
format Xsd Date
return getXsdDateFormat().format(date);
StringformatXsdDateTime(Date d)
format Xsd Date Time
return formatDate(d, XSD_DATETIME_FORMAT);
StringgetFormattedHoursByMinutes(int minutes)
get Formatted Hours By Minutes
return formatDate(new DateTime(startOfToday()).plusMinutes(minutes).toDate(), "H:mm");
StringgetHHmm()
get H Hmm
return simpleTimeFormat.format(new Date());
StringgetHHMM(Date date)
get HHMM
return get(date, HHMM);
StringgetHHMMSS()
Returns the current hh:mm:ss time.
SimpleDateFormat format = new SimpleDateFormat("hh:mm:ss");
return format.format(Calendar.getInstance().getTime());
DateFormatgetHHMMSS()
get HHMMSS
return new SimpleDateFormat("HH:mm:ss");
StringgetHHmmSS()
get H Hmm SS
Date d = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
return sdf.format(d);