mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +00:00
Userland: Make /bin/date pretty-print the date, too.
This commit is contained in:
parent
7e4376d469
commit
e2f27aa7b5
1 changed files with 9 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue