diff options
author | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-05 20:35:33 +0000 |
---|---|---|
committer | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-05 20:35:33 +0000 |
commit | 719c1cbcf96a18fc90af6e4ff2ba78d17a968388 (patch) | |
tree | b614cbe6a5705c7fe049cab2951218a397c6d1ec /src/modules/m_alltime.cpp | |
parent | 506137fa75ec09716a44ecf5fdc2fedeeddc0997 (diff) |
Modified the server-to-server TIME command to report the real time (without delta), and display the delta in the output from m_alltime
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5657 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_alltime.cpp')
-rw-r--r-- | src/modules/m_alltime.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index 4701b1cc1..0ce517886 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -21,11 +21,14 @@ class cmd_alltime : public command_t CmdResult Handle(const char **parameters, int pcnt, userrec *user) { char fmtdate[64]; - time_t time = ServerInstance->Time(); - strftime(fmtdate, sizeof(fmtdate), "%F %T", gmtime(&time)); + time_t now = ServerInstance->Time(); + strftime(fmtdate, sizeof(fmtdate), "%F %T", gmtime(&now)); + + // I'm too lazy to add a function to fetch the delta, so lets just cheat.. + int delta = time(NULL) - now; string msg = ":" + string(ServerInstance->Config->ServerName) + " NOTICE " + user->nick + " :Time for " + - ServerInstance->Config->ServerName + " is: " + fmtdate; + ServerInstance->Config->ServerName + " is: " + fmtdate + " (delta " + ConvToStr(delta) + " seconds)"; if (IS_LOCAL(user)) { |