@Test public void testTimestampToJavaOrUnix() { Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); long javaTime = System.currentTimeMillis(); cal.setTimeInMillis(javaTime); long julianTimestamp = DateTimeUtil.javaTimeToJulianTime(cal.getTimeInMillis()); assertEquals(javaTime, DateTimeUtil.julianTimeToJavaTime(julianTimestamp)); assertEquals(javaTime / 1000, DateTimeUtil.julianTimeToEpoch(julianTimestamp)); }
public static TimestampDatum createTimestampDatumWithJavaMillis(long millis) { return new TimestampDatum(DateTimeUtil.javaTimeToJulianTime(millis)); }