Java Utililty Methods Calendar Format

List of utility methods to do Calendar Format

Description

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

Method

StringtoInfo(Calendar calendar)
to Info
return toInfo(calendar.getTime());
StringtoShort(Calendar calendar)
to Short
return DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT).format(calendar.getTime());
StringtoSimpleFormat(Calendar cal)
Method toSimpleFormat.
return SIMPLE_FORMAT.format(cal.getTime());
StringtoW3C(Calendar cal)
convert Calendar to w3c format, See W3C format i.e.
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss Z");
fmt.setTimeZone(utcTZ);
return fmt.format(cal.getTime());