Java 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

StringformatDate(Date fecha)
format Date
if (fecha == null)
    fecha = new Date();
SimpleDateFormat formatoDelTexto = new SimpleDateFormat("yyyy/MM/dd");
return formatoDelTexto.format(fecha);
StringformatDate(Date in)
Formats a date in teh format yyyy-MM-dd
if (in == null) {
    return null;
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
return dateFormat.format(in);
StringformatDate(Date myDate)
format Date
return formatDateTime(myDate, patternDate);
StringformatDate(Date pDate, boolean pShowDateOnly)
Format the date to ISO 8601 format: "yyyy-MM-dd'T'HH:mm:ss"
if (pDate == null) {
    return "";
SimpleDateFormat dateFormat = null;
if (pShowDateOnly) {
    dateFormat = new SimpleDateFormat("yyyy-MM-dd");
} else {
    dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
...
StringformatDate(Date t)
format Date
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(t);
return new SimpleDateFormat("yyyy-MM-dd").format(t);
StringformatDate(Date tagValue)
format Date
return timestampFormat.get().format(tagValue);
StringformatDate(Date value)
Converts the given date to a string.
if (value == null) {
    return "";
return new SimpleDateFormat(MM_DD_YYYY).format(value);
StringformatDate(Date value)
format Date
String formattedValue;
if (value == null) {
    formattedValue = null;
} else {
    formattedValue = getTimeFormat().format(value);
return formattedValue;
StringformatDate(DateFormat format, Date date)
format Date
synchronized (format) {
    return format.format(date);
StringformatDate(final Calendar cal)
format Date
if (cal == null) {
    throw new NullPointerException("cal");
return formatDate(cal.getTime());