Skip to content

Commit 706fbe7

Browse files
committed
Add text-based datetime string in the json format too
1 parent fc0a7f9 commit 706fbe7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ static bool callback(FileMonitor *fm, FileMonitorEvent *ev) {
136136
uint64_t now = __sys_now ();
137137
printf ("\"time\":%" PRId64 ",", now);
138138
}
139+
if (fm->show_timestamps) {
140+
char datetime[20];
141+
time_ymdhms (datetime, sizeof (datetime));
142+
printf ("\"datetime\":\"%s\",", datetime);
143+
}
139144
if (ev->tstamp) {
140145
printf ("\"timestamp\":%" PRId64 ",", ev->tstamp);
141146
}

0 commit comments

Comments
 (0)