After some consideration, I decided to bite the bullet, and propose introducing native Pike datatypes (inspired by the SQL standard):
Time Timestamp Date Interval TimeTZ Inet Range
Where are they in the name space?
Code quality request: no nested ?:-expressions. Functions like this ought to be a series of if-return statements.
protected int(0..1) `<(mixed that) { return intp(that) ? nsecs < [int]that * NANOSECONDS : floatp(that) ? nsecs < [float]that * NANOSECONDS : objectp(that) && nsecs < ([object]that)->nsecs && !zero_type(([object]that)->nsecs); }