diff options
author | Clay Smith <claysmith158@gmail.com> | 2023-08-01 01:01:56 -0500 |
---|---|---|
committer | Clay Smith <claysmith158@gmail.com> | 2023-08-01 01:01:56 -0500 |
commit | ecb28155a6afcbe4c50ebe8e6bc112ff884af48a (patch) | |
tree | 9cd293fc1aa0473d370bf0167f51e5e8f5248f5e /notes/time_testing.c |
Diffstat (limited to 'notes/time_testing.c')
-rw-r--r-- | notes/time_testing.c | 20 |
1 files changed, 20 insertions, 0 deletions
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 <stdio.h> +#include <time.h> + + +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; +} |