Timestamp Module

Module Contents

Todo

jan_1_1900, time_from_string, time_to_string, no_such_timestamp, is_timestamp_valid, truncate_fractional_seconds, round_to_nearest_second, hours, minutes, seconds, milliseconds, microseconds, days, set_default_timestamp_output_format, default_timestamp_output_format, set_default_timestamp_input_format, default_timestamp_input_format throw errors when parsed by Breathe so documentation isn’t generated for these functions. The reason being, Breathe doesn’t easily support overloaded functions utilizing doxygenfunction::, need to figure out how to handle the manually declared overloaded functions.

typedef boost::posix_time::ptime tracktable::Timestamp

Use Boost timestamps in Tracktable.

Date/time math is such a pain to get right. We will be much happier and will spend much more time on trajectories if we delegate this to someone else who is more passionate about dates and times than moving objects.

This may be a part of our API where the underlying implementation shows through — you may need to use Boost constructs if you want to do time arithmetic on hours, minutes and seconds. There is room for improvement here.

typedef boost::posix_time::time_duration tracktable::Duration
typedef boost::gregorian::date tracktable::Date

Use Boost Gregorian dates in Tracktable.

As above, but worse. The notion of dividing a day into 24 equal parts has been around for at least a couple thousand years. Indexing those days, though… Gregorian? Julian? Babylonian? Mayan? Hebrew? Which calendar system do you use?

We throw up our hands in existential dismay and adopt the Gregorian calendar as the least terrible option.

const Timestamp tracktable::BeginningOfTime(jan_1_1900)
template<typename stream_type>
void tracktable::imbue_stream_with_timestamp_output_format(stream_type &stream, std::string const &format)

Change the string format for timestamp parsing.

This function will change the format used to parse timestamps. The effect is process-wide.

There are many flags available for use in the format. The following web page documents them all:

http://www.boost.org/doc/libs/1_55_0/doc/html/date_time/date_time_io.html

The default value is "%Y-%m-%d %H:%M:%S", corresponding to timestamps such as "2014-04-05 12:33:40".

Parameters:
  • stream[in] Stream to add timestamp information to

  • format[in] The format of the timestamp