]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/cmd_time.cpp
Add <hostchange:ports> to the m_hostchange module to implement feature in bug #363
[user/henk/code/inspircd.git] / src / cmd_time.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
6  * See: http://www.inspircd.org/wiki/index.php/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #include "inspircd.h"
15 #include "configreader.h"
16 #include "users.h"
17 #include "commands/cmd_time.h"
18
19
20
21 extern "C" DllExport command_t* init_command(InspIRCd* Instance)
22 {
23         return new cmd_time(Instance);
24 }
25
26 CmdResult cmd_time::Handle (const char** parameters, int pcnt, userrec *user)
27 {
28         struct tm* timeinfo;
29         time_t local = ServerInstance->Time();
30
31         timeinfo = localtime(&local);
32
33         char tms[26];
34         snprintf(tms,26,"%s",asctime(timeinfo));
35         tms[24] = 0;
36
37         user->WriteServ("391 %s %s :%s",user->nick,ServerInstance->Config->ServerName,tms);
38
39         return CMD_SUCCESS;
40 }