1 #include "fmt_tai.h"
2 #include "scheduled.h"
3 #include <time.h>
4 
5 
6 
7 int
fmt_tai(char * buf,unsigned int size,struct tai * t)8 fmt_tai(char *buf, unsigned int size, struct tai *t)
9 {
10 	struct tm *tm;
11 	time_t tt;
12 	tt=t->x-TAI_UTC_OFFSET;
13 	tm=localtime(&tt);
14 	if (!tm)
15 		return -1;
16 	if (!strftime(buf,size,"%Y-%m-%d %H:%M:%S",tm))
17 		return -1;
18 	return 0;
19 }
20