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 dateTime)
Use XSD datetime format without zone indication
String dot = new SimpleDateFormat("yyyy-MM-dd.HH:mm:ss").format(dateTime);
return dot.replaceAll("[.]", "T");
Stringformat(Date dt)
Format the date using the default date format.
DateFormat formatter = new SimpleDateFormat(_DEFAULT_DATE_FORMAT_);
return formatter.format(dt);
Stringformat(Date self, String format, TimeZone tz)

Create a String representation of this date according to the given format pattern and timezone.

SimpleDateFormat sdf = new SimpleDateFormat(format);
sdf.setTimeZone(tz);
return sdf.format(self);
Stringformat(Date time, String fmt)
format
SimpleDateFormat df = new SimpleDateFormat(fmt);
return df.format(time);
Stringformat(double number, int decimalPlace)
format
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(decimalPlace);
return df.format(number);
Stringformat(final Date date)
Formats a Date according to the default date format.
return format(date, SITOOLS_DATE_FORMAT);
Stringformat(final Date date)
Format date to utc date string.
return createDateFormat(INPUT_DATE_FORMATS[0], isTruncatedDate(date)).format(date);
Stringformat(final Date date)
format
final long duration = date.getTime();
final SimpleDateFormat simpleDateFormat;
if (duration < MILLIS_UPPER_BOUND) {
    simpleDateFormat = new SimpleDateFormat(MILLIS_FORMAT);
} else if (duration < SECONDS_UPPER_BOUND) {
    simpleDateFormat = new SimpleDateFormat(SECONDS_MILLIS_FORMAT);
} else if (duration < MINUTES_UPPER_BOUND) {
    simpleDateFormat = new SimpleDateFormat(MINUTES_SECONDS_MILLIS_FORMAT);
...
StringBufferformat(int level, String message, String source, boolean verbose)
format
return verbose ? formatVerbose(level, message, source) : formatNonVerbose(level, message, source);
Stringformat(java.util.Date date, String format)
format
return format(date, format, null);