...one of the most highly
regarded and expertly designed C++ library projects in the
world. — Herb Sutter and Andrei
boost::date_time::str_from_delimited_time_duration — Creates a time_duration object from a delimited string.
// In header: <boost/date_time/time_parsing.hpp> template<typename time_duration, typename char_type> time_duration str_from_delimited_time_duration(const std::basic_string< char_type > & s);
Expected format for string is "[-]h[h][:mm][:ss][.fff]". If the number of fractional digits provided is greater than the precision of the time duration type then the extra digits are truncated.
A negative duration will be created if the first character in string is a '-', all other '-' will be treated as delimiters. Accepted delimiters are "-:,.".