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
As well as some new supporting Vals: Val.nan Val.posinfty Val.neginfty
See my most recent commit on 8.1.
The proposed types are lightweight, fast (because I recently fixed mktime) and capable of holding the SQL equivalents; but can, of course, be used outside of the SQL context.
I added some minimal docs, but I don't see all of those appear. There seems to be something special with __builtin docs? Or am I simply doing something silly?
Is this spot agreeable for where the types should live? If not, any other spot that would seem more appropriate? I'd like to avoid putting them down under Sql somewhere, because they're more generic (and useful) than that.
As for the code itself: I tried moving it into separate .pike files, but that didn't go down well because of cyclic references; maybe it's solvable, but this seemed like the only way to get it working for now.
Also, some of the create() variants insist on generating warnings. I tried very hard to get rid of those, but it seems like that is impossible; so, presuming that the code is correct as is, the warnings probably need to be fixed in the compiler.