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

StringformatCalTime(Date time)
Returns a string from a date.
return iCalTimeFormat.format(time);
StringformatCapDate(Calendar cal)
Formats the given date as a [datetime].
SimpleDateFormat format = new SimpleDateFormat(DATETIME_FORMAT);
format.setTimeZone(cal.getTimeZone());
StringBuilder ret = new StringBuilder(format.format(cal.getTime()));
ret.insert(ret.length() - 2, ':');
return ret.toString();
StringformatCompleteDate(Date date)
format Complete Date
return tsvCompleteDateFormat.format(date);
StringformatCreationDate(String creationDate)
format Creation Date
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd MMM yyyy HH:mm");
SimpleDateFormat jiraDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
return simpleDateFormat.format(jiraDateFormat.parse(creationDate));
StringformatCurrentDateForDebug()
Formats the current date and time for debugging purposes.
return debugDate.format(Calendar.getInstance().getTime());
StringformatCurrentTime()
format Current Time
return getDateFormat().format(new Date());
StringformatCurrentTime()
format Current Time
return new SimpleDateFormat("yyyy-MM-dd HH-mm-ss.S Z").format(new Date());
StringformatCurrentTime(final String format)
format the current time
return dateToString(getTime(), format);
StringformatDate(Calendar currentDate, String pattern)
format Date
if (currentDate == null || pattern == null) {
    throw new NullPointerException("The arguments are null !");
Date date = currentDate.getTime();
return formatDate(date, pattern);
StringformatDate(Calendar time)
format Date
SimpleDateFormat formatter = new SimpleDateFormat("yyyy'-'MM'-'dd' 'HH':'mm':'ss'.'SSS");
TimeZone TZ_UTC = TimeZone.getTimeZone("UTC");
formatter.setTimeZone(TZ_UTC);
return formatter.format(time.getTime());