libtime++: Date and time calculation
libtime++: Date and time calculation Documentation
Author
Thomas Forbriger
Since
1997, 2012

This library supports numerical operations for dates and times with integer precision down to microseconds. Time comes in two different flavours:

  1. absolute time (like today at 10 o'clock) as supported by libtime::TAbsoluteTime
  2. relative times (like the time span between now and christmas) as supported by libtime::TRelativeTime For time differences (libtime::TRelativeTime) only positive values are accepted. Accidentally the library appears to handle negative value too. However, since the underlying Fortran code is designed to handle positive values only, functions should throw an exception upon negative values being passed.

The modules in the library support operations like:

  • calculate the number of samples in a time window
  • calculate the expected time and date for the first sample in the next data block
  • calculate the time gap between two data blocks
  • calculate the the index of the sample nearest to a given time
  • calculate the residual time between a given time and the nearest sample

The library provides interfaces in Fortran, C, C++. Unfortunately handling of leapseconds is not yet supported.

See also
example++.cc, tests/libtime++.cc