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

StringgetDisplayDate(Date date, String format)
get Display Date
SimpleDateFormat formatter = new SimpleDateFormat(format,
        Locale.getDefault());
return formatter.format(date);
StringgetFormatedDate(Date date, String format)
used to convert the specified date to the specified format
DateFormat dateFormat = new SimpleDateFormat(format,
        Locale.getDefault());
return dateFormat.format(date);
StringdateFormat(String sdate, String format)
date Format
SimpleDateFormat formatter = new SimpleDateFormat(format);
java.sql.Date date = java.sql.Date.valueOf(sdate);
String dateString = formatter.format(date);
return dateString;
StringdateFormat(String sdate, String format)
date Format
SimpleDateFormat formatter = new SimpleDateFormat(format);
java.sql.Date date = java.sql.Date.valueOf(sdate);
String dateString = formatter.format(date);
return dateString;
StringformatcurrentDate(int format)
formatcurrent Date
return formatDate(new Date(), format, "");
StringformatDataTime(Date date)
format Data Time
return DATETIME_FORMAT.format(date);
StringformatDate(Date date)
format Date
return DATE_FORMAT_YYYYMMDD_HHMMSS.format(date);
StringformatDate(Date date)
format Date
return FORMATTER.format(date);
StringformatDate(Date date)
format Date
return sdf.format(date);
StringformatDate(Date date, String pattern)
format Date
return formatDate(date, pattern, Locale.getDefault());