0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-28 00:14:07 +01:00

modules/console: Add a date cmd.

This commit is contained in:
Jason Volk 2018-09-16 21:38:34 -07:00
parent fb6bb04207
commit c580d42da2

View file

@ -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<system_point>()};
out << timef(buf, now, ircd::localtime) << std::endl;
out << timef(buf, now) << " (UTC)" << std::endl;
return true;
}
//
// mem
//