diff options
author | fadhil riyanto <me@fadev.org> | 2024-08-17 10:25:47 +0700 |
---|---|---|
committer | fadhil riyanto <me@fadev.org> | 2024-08-17 10:25:47 +0700 |
commit | 9720461319aed7add98a68c6f7b497737173b64a (patch) | |
tree | 4c087e74d2b8216624427abc23f61286ff9ea4f6 | |
parent | 8a72937090af0fe256a440a362ea2df28df300f3 (diff) |
generate time
Signed-off-by: fadhil riyanto <me@fadev.org>
-rw-r--r-- | init.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -1,4 +1,24 @@ +#include <time.h> +#include <stdio.h> +#include <unistd.h> +#include <pthread.h> +#include <sys/epoll.h> + +#define debug(x) printf("%s\n", x) + +static char* get_time() +{ + time_t rawtime; + struct tm * timeinfo; + + time (&rawtime); + timeinfo = localtime(&rawtime); + + return asctime(timeinfo) +} + int main(void) { + get_time(); return 0; }
\ No newline at end of file |