mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 11:39:44 +03:00
Userland: Make /bin/date pretty-print the date, too.
This commit is contained in:
parent
7e4376d469
commit
e2f27aa7b5
Notes:
sideshowbarker
2024-07-19 15:53:38 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e2f27aa7b54
@ -5,8 +5,16 @@ int main(int argc, char** argv)
|
||||
{
|
||||
(void) argc;
|
||||
(void) argv;
|
||||
|
||||
time_t now = time(nullptr);
|
||||
printf("%u\n", now);
|
||||
auto* tm = localtime(&now);
|
||||
printf("%4u-%02u-%02u %02u:%02u:%02u\n",
|
||||
tm->tm_year + 1900,
|
||||
tm->tm_mon + 1,
|
||||
tm->tm_mday,
|
||||
tm->tm_hour,
|
||||
tm->tm_min,
|
||||
tm->tm_sec);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user