Android Utililty Methods Date Format

List of utility methods to do Date Format

Description

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

Method

StringgetFormatDate(Date date)
get Format Date
return getFormatDateTime(date, "yyyy-MM-dd");
StringgetFormatDate(String format)
get Format Date
return getFormatDateTime(new Date(), format);
StringgetFormatDate(String format)
get Format Date
return getFormatDateTime(new Date(), format);
StringgetFormatDateAdd(Date date, int amount, String format)
get Format Date Add
Calendar cal = new GregorianCalendar();
cal.setTime(date);
cal.add(GregorianCalendar.DATE, amount);
return getFormatDateTime(cal.getTime(), format);
StringgetFormatDateAdd(Date date, int amount, String format)
get Format Date Add
Calendar cal = new GregorianCalendar();
cal.setTime(date);
cal.add(GregorianCalendar.DATE, amount);
return getFormatDateTime(cal.getTime(), format);
StringgetFormatDateTime(Date date, String format)
get Format Date Time
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(date);
StringgetFormatDateTime(Date date, String format)
get Format Date Time
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(date);
StringgetFormatDateTommorrow(String sourceDate, String format)
get Format Date Tommorrow
return getFormatDateAdd(getDateFromString(sourceDate, format), 1,
        format);
StringgetFormatDateTommorrow(String sourceDate, String format)
get Format Date Tommorrow
return getFormatDateAdd(getDateFromString(sourceDate, format), 1,
        format);
StringgetFormatShortTime(Date date)
get Format Short Time
return getFormatDateTime(date, "yyyy-MM-dd");