List of utility methods to do SQL Date Compare
boolean | compareDate(java.sql.Date date1, java.sql.Date date2) compare Date SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmm"); String str1 = formatter.format(date1); String str2 = formatter.format(date2); if (str1.equals(str2)) return true; else return false; |
long | compareDate(java.util.Date s1, java.util.Date s2) compare Date try { return compareDate(DEFAULT_DATE_YMD_FORMAT, toString(s1), toString(s2)); } catch (Exception e) { return -1; |
int | compareDates(Date date1, Date date2) Equivalent of compareTo() but actually works because Sun fucked up the JDK. if (date1 instanceof Timestamp) { if (date2 instanceof Timestamp) { return date1.compareTo(date2); } else { return date1.compareTo(new Timestamp(date2.getTime())); } else { if (date2 instanceof Timestamp) { ... |
int | compareSqlDate(Object left, Object right) compare Sql Date java.sql.Date l = (java.sql.Date) left;
java.sql.Date r = (java.sql.Date) right;
return l.compareTo(r);
|