about summary refs log tree commit diff
path: root/mdate.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdate.c')
-rw-r--r--mdate.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mdate.c b/mdate.c
new file mode 100644
index 0000000..fa2253d
--- /dev/null
+++ b/mdate.c
@@ -0,0 +1,15 @@
+#include <time.h>
+#include <unistd.h>
+
+int
+main() {
+	char buf[64];
+	time_t now = time(0);
+
+	ssize_t l = strftime(buf, sizeof buf,
+	    "%a, %d %b %Y %T %z\n", localtime(&now));
+	if (write(1, buf, l) == l)
+		return 0;
+
+	return 1;
+}