OSDN Git Service

addid library source 20140221
[zither/ds-zither.git] / sources / lib / libms / time_getr.c
1 #include<stdio.h>
2 #include<time.h>
3
4 #include "almemsys.h"
5
6
7 char * time_getr(char * buf)
8 {
9 time_t t;
10 struct tm tmbuf;
11
12 t = time(NULL);
13 localtime_r(&t, &tmbuf);
14
15 buf =  safe_sprintf(buf, BUF_MAX,"%04d:%02d:%02d:%02d:%02d:%02d",
16       tmbuf.tm_year + 1900,
17       tmbuf.tm_mon + 1,
18       tmbuf.tm_mday,
19       tmbuf.tm_hour,
20       tmbuf.tm_min,
21       tmbuf.tm_sec);
22
23 return buf;
24 }
25
26
27
28