Java Utililty Methods Date Long Format

List of utility methods to do Date Long Format

Description

The list of methods to do Date Long Format are organized into topic(s).

Method

LonggetLong(final Map map, final Object key)
Gets a Long from a Map in a null-safe manner.
Number answer = getNumber(map, key);
if (answer == null) {
    return null;
} else if (answer instanceof Long) {
    return (Long) answer;
return new Long(answer.longValue());
StringgetLongDate(Date date)
get Long Date
return (SIMPLE_DATE_FORMAT_LONG).format(date);
StringgetLongDate(Date date)
get Long Date
if (null == date)
    return "";
return new String(LONG_FORMAT.format(date));
LonggetLongDateByMidformat(String dateStr)
get Long Date By Midformat
Date d;
try {
    d = MID_FORMAT.parse(dateStr);
    return Long.valueOf(d.getTime());
} catch (ParseException e) {
    e.printStackTrace();
return new Date().getTime();
...
StringgetLongDateCurr()
get Long Date Curr
DateFormat dateFormat = new SimpleDateFormat("MM/dd/yy HH:mm");
Date date = new Date();
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
return dateFormat.format(date);
StringgetLongDateFormat(Date d)
Get the date - throws an illegal state exception if it is not one of the acceptable date values.
SimpleDateFormat longDateFormat = new SimpleDateFormat(longFormat);
return longDateFormat.format(d);
DateFormatgetLongDateFormatter()
get Long Date Formatter
return DateFormat.getDateInstance(DateFormat.LONG);
StringgetLongDateStr(Date sDate)
get Long Date Str
if (sDate == null)
    return "";
return new SimpleDateFormat("yyyy-MM-dd kk:mm:ss").format(sDate);
StringgetLongDateString(Date date)
yyyyMMddHHmmss
DateFormat dateFormat = new SimpleDateFormat(longFormat);
return formatDateString(date, dateFormat);
StringgetLongDateString(Date date)
get Long Date String
DateFormat dateFormat = new SimpleDateFormat(longFormat);
return getDateString(date, dateFormat);