summaryrefslogtreecommitdiff
path: root/notes/time_testing.c
diff options
context:
space:
mode:
Diffstat (limited to 'notes/time_testing.c')
-rw-r--r--notes/time_testing.c20
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;
+}