15 boost::gregorian::date d = t.date();
18 <<
"-" << std::setw(2) << std::setfill(
'0') << d.month().as_number()
19 <<
"-" << std::setw(2) << std::setfill(
'0') << d.day()
27 s << std::setw(2) << std::setfill(
'0') << dur.hours()
28 <<
":" << std::setw(2) << std::setfill(
'0') << dur.minutes()
29 <<
":" << std::setw(2) << std::setfill(
'0') << dur.seconds();
33 if (fsecs_precision) {
34 size_t fsecs = dur.fractional_seconds();
36 if (fsecs_precision < width) {
37 for (
auto i = 0; i < width - fsecs_precision; ++i) {
41 width = fsecs_precision;
44 s <<
"." << std::setw(width)
std::string durationToText(boost::posix_time::time_duration dur, size_t fsecs_precision=MAX_FSECS_PRECISION)
Converts StatsDuration to text.
std::string ptimeToText(boost::posix_time::ptime t, size_t fsecs_precision=MAX_FSECS_PRECISION)
Converts ptime structure to text.
const size_t MAX_FSECS_PRECISION
The number of digits of fractional seconds supplied by the underlying class, boost::posix_time.