/** * Get or create a date value for the given date. * * @param date the date * @return the value */ public static ValueDate get(Date date) { return fromDateValue(DateTimeUtils.dateValueFromDate(date.getTime())); }
/** * Get or create a timestamp value for the given timestamp. * * @param timestamp the timestamp * @return the value */ public static ValueTimestamp get(Timestamp timestamp) { long ms = timestamp.getTime(); long nanos = timestamp.getNanos() % 1000000; long dateValue = DateTimeUtils.dateValueFromDate(ms); nanos += DateTimeUtils.nanosFromDate(ms); return fromDateValueAndNanos(dateValue, nanos); }