@Test public void testDemonstrateSetNanosOnTimestampLosingMillis() { Timestamp ts1 = new Timestamp(120055); ts1.setNanos(60); Timestamp ts2 = new Timestamp(120100); ts2.setNanos(60); assertTrue(ts1.equals(ts2)); ts1 = DateUtil.getTimestamp(120055, 60); ts2 = DateUtil.getTimestamp(120100, 60); assertFalse(ts1.equals(ts2)); assertTrue(ts2.after(ts1)); }
public static Timestamp getTimestamp(long millis, int nanos) { Timestamp ts = new Timestamp(millis); ts.setNanos(ts.getNanos() + nanos); return ts; }
DateUtil { public static Timestamp getTimestamp(long millis, int nanos) { Timestamp ts = new Timestamp(millis); ts.setNanos(ts.getNanos() + nanos); return ts; } }
DateUtil { public static Timestamp getTimestamp(long millis, int nanos) { Timestamp ts = new Timestamp(millis); ts.setNanos(ts.getNanos() + nanos); return ts; } private  DateUtil(); }
DateUtil { public static Timestamp getTimestamp(long millis, int nanos) { Timestamp ts = new Timestamp(millis); ts.setNanos(ts.getNanos() + nanos); return ts; } private  DateUtil(); static Format getDateParser(String pattern); static Format getTimeParser(String pattern); static Format getTimestampParser(String pattern); static Format getDateFormatter(String pattern); static Date parseDate(String dateValue); static Time parseTime(String timeValue); static Timestamp parseTimestamp(String timeValue); static Timestamp getTimestamp(long millis, int nanos); static Timestamp getTimestamp(BigDecimal bd); }
DateUtil { public static Timestamp getTimestamp(long millis, int nanos) { Timestamp ts = new Timestamp(millis); ts.setNanos(ts.getNanos() + nanos); return ts; } private  DateUtil(); static Format getDateParser(String pattern); static Format getTimeParser(String pattern); static Format getTimestampParser(String pattern); static Format getDateFormatter(String pattern); static Date parseDate(String dateValue); static Time parseTime(String timeValue); static Timestamp parseTimestamp(String timeValue); static Timestamp getTimestamp(long millis, int nanos); static Timestamp getTimestamp(BigDecimal bd); static final TimeZone DATE_TIME_ZONE; static final String DEFAULT_DATE_FORMAT; static final Format DEFAULT_DATE_FORMATTER; static final String DEFAULT_MS_DATE_FORMAT; static final Format DEFAULT_MS_DATE_FORMATTER; }