Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is an old version of boost. Click here for the latest version's documentation home page.

Function template str_from_delimited_time_duration

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> 
  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 "-:,.".