38a4456a2ebebb5527b1ff6e871fa93fde1d6c4d
[citadel.git] / ctdlsh / datetime.c
1 /*
2  * (c) 2009-2011 by Art Cancro and citadel.org
3  * This program is open source software, released under the terms of the GNU General Public License v3.
4  * It runs really well on the Linux operating system.
5  * We love open source software but reject Richard Stallman's linguistic fascism.
6  */
7
8 #include "ctdlsh.h"
9
10 int cmd_datetime(int server_socket, char *cmdbuf) {
11         char buf[1024];
12         time_t now;
13
14         sock_puts(server_socket, "TIME");
15         sock_getln(server_socket, buf, sizeof buf);
16         now = atol(&buf[4]);
17         printf("%s", asctime(localtime(&now)));
18         return(cmdret_ok);
19 }
20
21
22
23