Skip to content

Commit c580d42

Browse files
committed
modules/console: Add a date cmd.
1 parent fb6bb04 commit c580d42

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

modules/console.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,19 @@ console_cmd__uptime(opt &out, const string_view &line)
562562
return true;
563563
}
564564

565+
bool
566+
console_cmd__date(opt &out, const string_view &line)
567+
{
568+
out << ircd::time() << std::endl;
569+
570+
thread_local char buf[128];
571+
const auto now{ircd::now<system_point>()};
572+
out << timef(buf, now, ircd::localtime) << std::endl;
573+
out << timef(buf, now) << " (UTC)" << std::endl;
574+
575+
return true;
576+
}
577+
565578
//
566579
// mem
567580
//

0 commit comments

Comments
 (0)