mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-11 04:32:30 +00:00
Cleanup of log time display.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@346 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <ctime>
|
||||
#include <sstream>
|
||||
|
||||
#include "core/download.h"
|
||||
#include "utils/timer.h"
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
@@ -31,4 +33,20 @@ print_download_status(core::Download* d) {
|
||||
return str.str();
|
||||
}
|
||||
|
||||
std::string
|
||||
print_hhmmss(utils::Timer t) {
|
||||
std::tm *u = std::localtime(&t.tval().tv_sec);
|
||||
|
||||
if (u == NULL)
|
||||
return "inv_time";
|
||||
|
||||
std::stringstream str;
|
||||
str.width(2);
|
||||
str.fill('0');
|
||||
|
||||
str << u->tm_hour << ':' << u->tm_min << ':' << u->tm_sec;
|
||||
|
||||
return str.str();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user