This commit is contained in:
fgerlits 2006-11-08 10:23:40 +00:00
parent 16a8907e5d
commit 3944d3d8da

View file

@ -205,21 +205,32 @@ TimeConversion :: timeDurationToHhMmSsString(
Ptr<time_duration>::Ref duration) Ptr<time_duration>::Ref duration)
throw () throw ()
{ {
int hours = duration->hours();
int minutes = duration->minutes();
int seconds = duration->seconds();
if (duration->fractional_seconds() >= 500000) {
++seconds;
}
if (seconds == 60) {
seconds = 0;
++minutes;
}
if (minutes == 60) {
minutes = 0;
++hours;
}
std::stringstream stringStream; std::stringstream stringStream;
stringStream << std::dec stringStream << std::dec
<< std::setw(2) << std::setw(2)
<< std::setfill('0') << std::setfill('0')
<< duration->hours() << hours
<< ":" << ":"
<< std::setw(2) << std::setw(2)
<< std::setfill('0') << std::setfill('0')
<< duration->minutes(); << minutes
<< ":"
int seconds = duration->seconds();
if (duration->fractional_seconds() >= 500000) {
++seconds;
}
stringStream << ":"
<< std::setw(2) << std::setw(2)
<< std::setfill('0') << std::setfill('0')
<< seconds; << seconds;