Java Utililty Methods Date Format ISO

List of utility methods to do Date Format ISO

Description

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

Method

StringgetISO8601UTCString(Date d)
get ISOUTC String
try {
    SimpleDateFormat formatter = new SimpleDateFormat();
    formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
    SimpleDateFormat simple = new SimpleDateFormat("M/d/yy h:mm a");
    Date UTCDate = simple.parse(formatter.format(d.getTime()));
    SimpleDateFormat ISO8061Formatter = new SimpleDateFormat(ISO8061UTC);
    return ISO8061Formatter.format(UTCDate);
} catch (Exception e) {
...
StringgetISODate()
get ISO Date
return getISODate(new Date());
StringgetISODate()
Get todays date and format into an ISO date string and return
return isoFormatter.format(getToday());
StringgetISODate(int i)
get ISO Date
DateFormat df = new SimpleDateFormat("YYYY-MM-dd");
Calendar cal = Calendar.getInstance();
cal.add(Calendar.YEAR, -i);
String date = df.format(cal.getTime());
return date;
DateFormatgetIsoDateFormat()
get Iso Date Format
return new SimpleDateFormat(ISO_DATE_PATTERN);
DateFormatgetIsoDateFormat()
Retrieve the common ISO date format.
return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
DateFormatgetIsoDateFormater()
Returns the isoDateFormater.
return getFormatter();
SimpleDateFormatgetISODateFormatterShort()
get ISO Date Formatter Short
return new SimpleDateFormat("yyyy-MM-dd");
StringgetISODateStr(Date date)
get ISO Date Str
return isoDateFormat.format(date);
StringgetISODateStringFormat(Date ts)
get ISO Date String Format
String result = "";
try {
    String temp = new java.text.SimpleDateFormat("yyyy-MM-dd").format(ts);
    result = temp.substring(0, 4);
    result = result + "-";
    result = result + temp.substring(5, 7);
    result = result + "-";
    result = result + temp.substring(8, 10);
...