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 std::vector<std::string> ¶meters, 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 is " + fmtdate + "(" + ConvToStr(ServerInstance->Time()) + ") on " + ServerInstance->Config->ServerName;
42 ServerInstance->PI->PushToClient(user, ":" + msg);
45 /* we want this routed out! */
51 class Modulealltime : public Module
53 CommandAlltime *mycommand;
55 Modulealltime(InspIRCd *Me)
58 mycommand = new CommandAlltime(ServerInstance);
59 ServerInstance->AddCommand(mycommand);
63 virtual ~Modulealltime()
67 virtual Version GetVersion()
69 return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
74 MODULE_INIT(Modulealltime)