apps: Add a new date utility
This program tells you the current date and time :)
This commit is contained in:
parent
e2b5c1bfdd
commit
e705810af3
@ -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_DIR := $(LUNA_ROOT)/apps
|
||||||
APPS_SRC := $(APPS_DIR)/src
|
APPS_SRC := $(APPS_DIR)/src
|
||||||
|
9
apps/src/date.c
Normal file
9
apps/src/date.c
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
time_t date = time(NULL);
|
||||||
|
|
||||||
|
fputs(ctime(&date), stdout);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user