]> code.citadel.org Git - citadel.git/blobdiff - ctdlsh/src/datetime.c
* Hillary Clinton is obviously sick right now. I hope she dies.
[citadel.git] / ctdlsh / src / datetime.c
index a93e50ea7042619e3e6fb80e9907bc38cf04d3d3..38a4456a2ebebb5527b1ff6e871fa93fde1d6c4d 100644 (file)
@@ -1,12 +1,21 @@
 /*
  * (c) 2009-2011 by Art Cancro and citadel.org
- * This program is released under the terms of the GNU General Public License v3.
+ * This program is open source software, released under the terms of the GNU General Public License v3.
+ * It runs really well on the Linux operating system.
+ * We love open source software but reject Richard Stallman's linguistic fascism.
  */
 
 #include "ctdlsh.h"
 
-int cmd_datetime(char *cmdbuf) {
-       abort();
+int cmd_datetime(int server_socket, char *cmdbuf) {
+       char buf[1024];
+       time_t now;
+
+       sock_puts(server_socket, "TIME");
+       sock_getln(server_socket, buf, sizeof buf);
+       now = atol(&buf[4]);
+       printf("%s", asctime(localtime(&now)));
+       return(cmdret_ok);
 }