RFC: Time Library 0.1

Aaron Denney wnoise at ofb.net
Thu Jul 14 20:11:50 EDT 2005

On 2005-07-06, John Meacham <john at repetae.net> wrote:
> But the beauty of TAI is that interval and absolute times are on the
> same scale.

True, but so what?

> I would argue that it is the one type where arithmetic
> actually makes sense. you can subtract two dates and get an absolute
> measure of the time difference between them.


> or add two dates and get the sum of their offsets from 1970. (there
> is a zero time, the TAI epoch).

Never useful.  The type system should be used to prevent it.

> Even division and multiplication make sense (but the dimensionalities
> are a little more iffy with them, so I'd convert to integers first,
> however the math is sound).

The conversion to integers should be explicit.

> For TAI, you don't need separate Difference and Absolute types because
> in essence, all TAI values are offsets, with an implied endpoint at
> 1970-1-1 0:0:0.

False, and true.  This is essentially the different between an affine
space and a vector space -- an affine space, such as points are a
torsor for the corresponding vector space of durations.  The numeric
classes need to be more fine grained.

Aaron Denney

More information about the Libraries mailing list