ctdlsh now has two working commands, 'date' and 'passwd'
[citadel.git] / ctdlsh / src / datetime.c
1 /*
2  * (c) 2009-2011 by Art Cancro and citadel.org
3  * This program is released under the terms of the GNU General Public License v3.
4  */
5
6 #include "ctdlsh.h"
7
8 int cmd_datetime(int server_socket, char *cmdbuf) {
9         char buf[1024];
10         time_t now;
11
12         sock_puts(server_socket, "TIME");
13         sock_getln(server_socket, buf, sizeof buf);
14         now = atol(&buf[4]);
15         printf("%s", asctime(localtime(&now)));
16         return(cmdret_ok);
17 }
18
19
20
21