srecord Timestamp(long date) implements Comparable { *() { date = now(); } *(Date date) { if (date != null) this.date = date.getTime(); } long unixDate aka toLong() { ret date; } long unixSeconds() { ret unixDate()/1000; } toString { ret formatLocalDateWithSeconds(date); } // Hmm. Should Timestamp(0) be equal to null? Question, questions... public int compareTo(Timestamp t) { ret t == null ? 1 : cmp(date, t.date); } Timestamp plus(Seconds seconds) { ret plus(seconds?.getDouble()); } Timestamp plus aka plusSeconds(double seconds) { ret Timestamp(date+toMS(seconds)); } // returns milliseconds long minus(Timestamp ts) { ret unixDate()-ts.unixDate(); } Timestamp minus(long milliseconds) { ret Timestamp(date-milliseconds); } long sysTime() { ret clockTimeToSystemTime(date); } Duration minusAsDuration(Timestamp ts) { ret Duration.ofMillis(minus(ts)); } }