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(List list, int scale)
format
if (list == null) {
    return null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
StringBuilder sb = new StringBuilder();
sb.append("[");
for (int i = 0; i < list.size(); i++) {
    T t = list.get(i);
...
Stringformat(long time)
format
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return simpleDateFormat.format(new Date(time));
Stringformat(long time)
format
return format(new Date(time), DEFAULT_PATTERN);
Stringformat(Number price)
format
return currencyFormatter.format(price);
Stringformat(String format, Date val)
Format a Date into a string with the format of the format argument.
if (val == null)
    return null;
SimpleDateFormat formatter = new SimpleDateFormat(format);
formatter.setLenient(false);
return formatter.format(val);
Stringformat(String pattern)
Formats actual date with specified pattern.
return format(pattern, new Date());
Stringformat(String str)
format
return String.format("%tF", parse(str, "EEE MMM dd HH:mm:ss zzz yyyy", Locale.US));
Stringformat16ByDate(Date aDate)
format By Date
SimpleDateFormat sdf = new SimpleDateFormat(_16DIGIT_DATE_TIME);
return sdf.format(aDate);
Stringformat1StringToformat2String(String dateStr)
format String Toformat String
return format2.format(format1.parse(dateStr));
Stringformat2NormalTime(Date date)
format Normal Time
if (null == date) {
    return null;
return new SimpleDateFormat(NORMAL_TIME).format(date);