mirror of
https://github.com/inspircd/inspircd.git
synced 2025-04-22 16:01:29 -04:00
Improve this to show time with and without delta, without the user having to work it out in their head
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6684 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
5bbc794c7d
commit
0ce46290ae
@ -30,13 +30,16 @@ class cmd_alltime : public command_t
|
|||||||
CmdResult Handle(const char **parameters, int pcnt, userrec *user)
|
CmdResult Handle(const char **parameters, int pcnt, userrec *user)
|
||||||
{
|
{
|
||||||
char fmtdate[64];
|
char fmtdate[64];
|
||||||
time_t now = ServerInstance->Time();
|
char fmtdate2[64];
|
||||||
|
time_t now = ServerInstance->Time(false);
|
||||||
strftime(fmtdate, sizeof(fmtdate), "%F %T", gmtime(&now));
|
strftime(fmtdate, sizeof(fmtdate), "%F %T", gmtime(&now));
|
||||||
|
now = ServerInstance->Time(true);
|
||||||
|
strftime(fmtdate2, sizeof(fmtdate2), "%F %T", gmtime(&now));
|
||||||
|
|
||||||
int delta = ServerInstance->GetTimeDelta();
|
int delta = ServerInstance->GetTimeDelta();
|
||||||
|
|
||||||
string msg = ":" + string(ServerInstance->Config->ServerName) + " NOTICE " + user->nick + " :Time for " +
|
string msg = ":" + string(ServerInstance->Config->ServerName) + " NOTICE " + user->nick + " :System time for " +
|
||||||
ServerInstance->Config->ServerName + " is: " + fmtdate + " (delta " + ConvToStr(delta) + " seconds)";
|
ServerInstance->Config->ServerName + " is: " + fmtdate + " (delta " + ConvToStr(delta) + " seconds): Time with delta: "+ fmtdate2;
|
||||||
|
|
||||||
if (IS_LOCAL(user))
|
if (IS_LOCAL(user))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user