aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_alltime.cpp
diff options
context:
space:
mode:
authorGravatar Peter Powell2014-05-02 16:39:40 +0100
committerGravatar Attila Molnar2014-06-25 14:31:25 +0200
commitda9adf9e29a1e7e0f914b494972013d0c0c35672 (patch)
treeb60b2cf59602a93b7a3c550ca6c39c38c0b888fe /src/modules/m_alltime.cpp
parentInherit ThreadQueueData from Mutex to avoid duplicating code (diff)
Add formatting to InspIRCd::TimeString; switch all code to use it.
m_httpd also now uses the correct timestamp format. Windows-specific fixes by @attilamolnar, original PR #849
Diffstat (limited to 'src/modules/m_alltime.cpp')
-rw-r--r--src/modules/m_alltime.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp
index 58f7c4fb5..ceee4abbc 100644
--- a/src/modules/m_alltime.cpp
+++ b/src/modules/m_alltime.cpp
@@ -31,9 +31,7 @@ class CommandAlltime : public Command
CmdResult Handle(const std::vector<std::string> &parameters, User *user)
{
- char fmtdate[64];
- time_t now = ServerInstance->Time();
- strftime(fmtdate, sizeof(fmtdate), "%Y-%m-%d %H:%M:%S", gmtime(&now));
+ const std::string fmtdate = InspIRCd::TimeString(ServerInstance->Time(), "%Y-%m-%d %H:%M:%S");
std::string msg = ":" + ServerInstance->Config->ServerName + " NOTICE " + user->nick + " :System time is " + fmtdate + " (" + ConvToStr(ServerInstance->Time()) + ") on " + ServerInstance->Config->ServerName;