Xinqi Bao's Git
projects
/
slstatus.git
/ blob
summary
|
log
|
commit
|
diff
|
tree
history
|
raw
|
HEAD
swap: OS split
[slstatus.git]
/
components
/
datetime.c
1
/* See LICENSE file for copyright and license details. */
2
#include <time.h>
3
4
#include
"../util.h"
5
6
const char
*
7
datetime
(
const char
*
fmt
)
8
{
9
time_t
t
;
10
11
t
=
time
(
NULL
);
12
if
(
strftime
(
buf
,
sizeof
(
buf
),
fmt
,
localtime
(&
t
)) ==
0
)
13
return
NULL
;
14
15
return
buf
;
16
}