2009-10-11 20:11:09 +00:00
|
|
|
// vim:ts=8:expandtab
|
|
|
|
#include <time.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2011-04-21 18:49:22 +00:00
|
|
|
void print_time(const char *format, struct tm *current_tm) {
|
2009-10-11 20:11:09 +00:00
|
|
|
static char part[512];
|
|
|
|
/* Get date & time */
|
2010-06-17 19:33:28 +00:00
|
|
|
if (current_tm == NULL) {
|
|
|
|
return;
|
|
|
|
}
|
2009-10-11 20:11:09 +00:00
|
|
|
(void)strftime(part, sizeof(part), format, current_tm);
|
|
|
|
printf("%s", part);
|
|
|
|
}
|