From e705810af3e0398818fc9e4ed882d9087217728f Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 30 Oct 2022 09:09:24 +0100 Subject: [PATCH] apps: Add a new date utility This program tells you the current date and time :) --- apps/Makefile | 2 +- apps/src/date.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 apps/src/date.c diff --git a/apps/Makefile b/apps/Makefile index f8233bfc..95b4d700 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -1,4 +1,4 @@ -APPS := init sh uname uptime hello ps ls args cat stat su session +APPS := init sh uname uptime hello ps ls args cat stat su session date APPS_DIR := $(LUNA_ROOT)/apps APPS_SRC := $(APPS_DIR)/src diff --git a/apps/src/date.c b/apps/src/date.c new file mode 100644 index 00000000..b8243899 --- /dev/null +++ b/apps/src/date.c @@ -0,0 +1,9 @@ +#include +#include + +int main() +{ + time_t date = time(NULL); + + fputs(ctime(&date), stdout); +} \ No newline at end of file