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

StringformatFileDate(Date from)
format File Date
return dateFormatFor(SIMPLE_DATE_FORMAT, "UTC").format(from);
StringformatFilesystemOrder(Date date)
Formats the given date to obtain a String date to order files in the filesystem.
return FILESYSTEM_ORDER.format(date);
StringformatForCookieExpiry(Date date)
format For Cookie Expiry
return formatDate(date, PATTERN_RFC1123_HYPHENS);
StringformatForFileName()
format For File Name
return formatForFileName(new Date());
StringformatForHttpHeader(long unixTime)
Can be used to format a unix timestamp into http header compatible strings.
return getRFC1123_DateFormat().format(new Date(unixTime));
StringformatFromDate(Date date)
format From Date
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(date);
DateformatFromString(String date)
format From String
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
    return sdf.parse(date);
} catch (ParseException e) {
return null;
StringformatFullDate(Object date)
format Full Date
return formatDate(date, "yyyy-MM-dd HH:mm:ss");
StringformatFullTime(Date date)
format Full Time
return formatFullTime(date, TimeZone.getTimeZone("UTC"));
StringformatHDate(java.util.Date date)
format H Date
return format(date, "yyyy-MM-dd HH:mm:ss");