]> git.sur5r.net Git - i3/i3status/blob - src/print_time.c
Breaks configfiles! Major refactoring of i3status, see below
[i3/i3status] / src / print_time.c
1 // vim:ts=8:expandtab
2 #include <time.h>
3 #include <stdio.h>
4 #include <stdlib.h>
5
6 void print_time(const char *format) {
7         static char part[512];
8         /* Get date & time */
9         time_t current_time = time(NULL);
10         struct tm *current_tm = localtime(&current_time);
11         (void)strftime(part, sizeof(part), format, current_tm);
12         printf("%s", part);
13 }