From c580d42da2a94ca75fe5e3a84fc20e0692128ad2 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 16 Sep 2018 21:38:34 -0700 Subject: [PATCH] modules/console: Add a date cmd. --- modules/console.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/console.cc b/modules/console.cc index 98259f722..85484117e 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -562,6 +562,19 @@ console_cmd__uptime(opt &out, const string_view &line) return true; } +bool +console_cmd__date(opt &out, const string_view &line) +{ + out << ircd::time() << std::endl; + + thread_local char buf[128]; + const auto now{ircd::now()}; + out << timef(buf, now, ircd::localtime) << std::endl; + out << timef(buf, now) << " (UTC)" << std::endl; + + return true; +} + // // mem //