List of utility methods to do Timestamp Compare
boolean | after(Timestamp t1, Timestamp t2) after if (t1 == null || t2 == null) { return false; return t1.after(t2); |
boolean | before(Timestamp t1, Timestamp t2) before if (t1 == null || t2 == null) { return false; return t1.before(t2); |
int | compare(Timestamp t1, Timestamp t2, int what) compare Calendar c1 = Calendar.getInstance(); c1.setTime(t1); Calendar c2 = Calendar.getInstance(); c2.setTime(t2); int number = 0; switch (what) { case Calendar.YEAR: number = c1.get(Calendar.YEAR) - c2.get(Calendar.YEAR); ... |
boolean | equals(Timestamp t1, Timestamp t2) equals if (t1 == null && t2 == null) { return true; } else { if (t1 == null) { return t2.equals(t1); } else { return t1.equals(t2); |