Java Utililty Methods yyyy

List of utility methods to do yyyy

Description

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

Method

StringformatarData(String pattern, Date data)
formatar Data
SimpleDateFormat dateFormat = new SimpleDateFormat(pattern);
return dateFormat.format(data);
StringformatarDataArquivo(Date data)
Formata uma data para arquivo no padrao ddMMyyyy.
if (data != null)
    return formatarData(data, FORMATO_DATA_DD_MM_AAAA);
else
    return DATA_NULA_ARQUIVO;
StringformatAsCassandraDate(Date date)
Formats as a date only string
SimpleDateFormat parser = new SimpleDateFormat();
parser.setLenient(false);
parser.applyPattern(ISO8601_DATE_ZONE);
return parser.format(date);
StringformatAsNumber(Date date)
format As Number
synchronized (NUMBER_DATE_FORMAT) {
    return NUMBER_DATE_FORMAT.format(date);
StringformatBySlashForm(Date aDate)
format By Slash Form
SimpleDateFormat sdf = new SimpleDateFormat(_8DIGIT_DATE_1);
return sdf.format(aDate);
StringformatDate(Calendar cal, String pattern)
format Date
return getSDFormat(pattern).format(cal.getTime());
StringformatDate(Calendar calendar, String format)
format Date
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(calendar.getTime());
StringformatDate(Date date, String datePattern)
Format date with specified pattern yyyy-MM-dd
String ret = null;
try {
    DateFormat dateFormat = new SimpleDateFormat(datePattern);
    ret = dateFormat.format(date);
} catch (Exception e) {
    e.printStackTrace();
return ret;
...
StringformatDate(Date date, String format)
format Date
SimpleDateFormat formatter = new SimpleDateFormat(format);
System.out.println(formatter.format(date).toString());
return formatter.format(date).toString();
StringformatDate(Date date, String format)
format Date
if (date == null) {
    return null;
return new SimpleDateFormat(format).format(date);