1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 /* $ModDesc: Display timestamps from all servers connected to the network */
18 class CommandAlltime : public Command
21 CommandAlltime(InspIRCd *Instance) : Command(Instance, "ALLTIME", "o", 0)
23 this->source = "m_alltime.so";
25 translation.push_back(TR_END);
28 CmdResult Handle(const char* const* parameters, int pcnt, User *user)
31 time_t now = ServerInstance->Time();
32 strftime(fmtdate, sizeof(fmtdate), "%Y-%m-%d %H:%M:%S", gmtime(&now));
34 std::string msg = ":" + std::string(ServerInstance->Config->ServerName) + " NOTICE " + user->nick + " :System time for " +
35 ServerInstance->Config->ServerName + " is: " + fmtdate;
43 ServerInstance->PI->PushToClient(user, msg);
46 /* we want this routed out! */
52 class Modulealltime : public Module
54 CommandAlltime *mycommand;
56 Modulealltime(InspIRCd *Me)
59 mycommand = new CommandAlltime(ServerInstance);
60 ServerInstance->AddCommand(mycommand);
64 virtual ~Modulealltime()
68 virtual Version GetVersion()
70 return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
75 MODULE_INIT(Modulealltime)