From ecb28155a6afcbe4c50ebe8e6bc112ff884af48a Mon Sep 17 00:00:00 2001 From: Clay Smith Date: Tue, 1 Aug 2023 01:01:56 -0500 Subject: First commit --- notes/time_testing.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 notes/time_testing.c (limited to 'notes/time_testing.c') diff --git a/notes/time_testing.c b/notes/time_testing.c new file mode 100644 index 0000000..014ecca --- /dev/null +++ b/notes/time_testing.c @@ -0,0 +1,20 @@ +#include +#include + + +int main(void) +{ + time_t cur_time_sec; + struct tm* time_values; + char buffer[100]; + + time(&cur_time_sec); + + time_values = localtime( &cur_time_sec); + + strftime(buffer, 100, "%A, %H:%M", time_values); + + + printf("Time is: %s\n", buffer); + return 0; +} -- cgit v1.2.1