blob: a1bb34cdf3e089d0a4fef62cd0c3bea05b274910 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
// vim:ts=8:expandtab
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <yajl/yajl_gen.h>
#include "i3status.h"
void print_time(yajl_gen json_gen, char *buffer, const char *format, struct tm *current_tm) {
char *outwalk = buffer;
if (current_tm == NULL)
return;
/* Get date & time */
outwalk += strftime(outwalk, 4095, format, current_tm);
*outwalk = '\0';
OUTPUT_FULL_TEXT(buffer);
}
|