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:
parent
fb6bb04207
commit
c580d42da2
1 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue