List of utility methods to do SQL Date Format
String | formatDate(java.sql.Date value) format Date return formatDate(value, ISO_DATE_FORMAT);
|
String | formatDate(java.sql.Date value, String defaultFormat) format Date if (value == null) { return ""; String strFormatStyle = StringUtils.isEmpty(defaultFormat) ? ISO_DATE_FORMAT : defaultFormat; SimpleDateFormat objSimpleDateFormat = new SimpleDateFormat( strFormatStyle); return objSimpleDateFormat.format(value); ... |
String | formatDate(java.util.Date value) format Date return formatDate(value, ISO_DATE_FORMAT);
|
String | formatDate(java.util.Date value, String defaultFormat) format Date if (value == null) { return ""; String strFormatStyle = StringUtils.isEmpty(defaultFormat) ? ISO_DATE_FORMAT : defaultFormat; SimpleDateFormat objSimpleDateFormat = new SimpleDateFormat( strFormatStyle); return objSimpleDateFormat.format(value); ... |
String | DateToStringSQL(Date date, String separador) Date To String SQL if (date == null) { return null; Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int dia = calendar.get(Calendar.DAY_OF_MONTH); String stringDia = dia < 10 ? "0" + dia : String.valueOf(dia); int mes = calendar.get(Calendar.MONTH) + 1; ... |
String | DateToString(Date date, String separador) Date To String if (date == null) { return null; Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int dia = calendar.get(Calendar.DAY_OF_MONTH); String stringDia = dia < 10 ? "0" + dia : String.valueOf(dia); int mes = calendar.get(Calendar.MONTH) + 1; ... |
String | DateToString(Date date) Date To String return DateToString(date, "-"); |
String | date2String(java.sql.Date date) date String if (date == null) return ""; return (date.getYear() + 1900) + "-" + (date.getMonth() + 1) + "-" + date.getDate(); |