From a43550fb9af5110d174905e506e6016eb13bb270 Mon Sep 17 00:00:00 2001 From: apio Date: Fri, 24 Mar 2023 21:48:43 +0100 Subject: [PATCH] apps: Add date --- apps/CMakeLists.txt | 1 + apps/date.c | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 apps/date.c diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index 1e6cb60b..7e009718 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -10,3 +10,4 @@ luna_app(init.c init) luna_app(cat.c cat) luna_app(edit.c edit) luna_app(sh.c sh) +luna_app(date.c date) diff --git a/apps/date.c b/apps/date.c new file mode 100644 index 00000000..6ff4174e --- /dev/null +++ b/apps/date.c @@ -0,0 +1,10 @@ +#include +#include +#include + +int main() +{ + time_t now = time(NULL); + + fputs(ctime(&now), stdout); +}