From c76f6eaa91ba59968c50bddd8e20e3c9ac3445e7 Mon Sep 17 00:00:00 2001 From: lotodore Date: Fri, 30 Nov 2007 21:29:42 +0000 Subject: [PATCH] Display uptime in days, not hours. --- src/net/common/servermanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net/common/servermanager.cpp b/src/net/common/servermanager.cpp index deeea3d7..2fbc7d88 100644 --- a/src/net/common/servermanager.cpp +++ b/src/net/common/servermanager.cpp @@ -111,11 +111,11 @@ ServerManager::SignalIrcChatMsg(const std::string &nickName, const std::string & else if (command == "stat") { ServerStats tmpStats = GetLobbyThread().GetStats(); - boost::posix_time::ptime curTime(boost::posix_time::second_clock::local_time()); { + boost::posix_time::time_duration timeDiff(boost::posix_time::second_clock::local_time() - GetLobbyThread().GetStartTime()); ostringstream statStream; statStream - << "Server uptime................ " << curTime - GetLobbyThread().GetStartTime(); + << "Server uptime................ " << timeDiff.hours() / 24 << " days " << timeDiff.hours() % 24 << " hours " << timeDiff.minutes() << " minutes " << timeDiff.seconds() << " seconds"; m_ircThread->SendChatMessage(statStream.str()); } {