diff options
author | Gerrit Pape <pape@smarden.org> | 2004-03-02 20:05:29 +0000 |
---|---|---|
committer | Gerrit Pape <pape@smarden.org> | 2004-03-02 20:05:29 +0000 |
commit | b2d115e0eb377f24e27a91b5310897134a080ef9 (patch) | |
tree | f184ace9326e3ab6c74ff2306d667d810b4e55fa /src/fmt_ptime.c | |
parent | af655650dfec191e3700cd86410ca62be1fbc5d6 (diff) | |
download | runit-b2d115e0eb377f24e27a91b5310897134a080ef9.tar.gz runit-b2d115e0eb377f24e27a91b5310897134a080ef9.tar.xz runit-b2d115e0eb377f24e27a91b5310897134a080ef9.zip |
use gmtime(), not localtime().
Diffstat (limited to 'src/fmt_ptime.c')
-rw-r--r-- | src/fmt_ptime.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fmt_ptime.c b/src/fmt_ptime.c index b78f9d7..7c8adce 100644 --- a/src/fmt_ptime.c +++ b/src/fmt_ptime.c @@ -1,3 +1,4 @@ +#include <time.h> #include "fmt_ptime.h" #include "fmt.h" @@ -7,7 +8,7 @@ unsigned int fmt_ptime(char *s, struct taia *ta) { if (ta->sec.x < 4611686018427387914ULL) return(0); /* impossible? */ u =ta->sec.x -4611686018427387914ULL; - if (! (t =localtime((time_t*)&u))) return(0); + if (! (t =gmtime((time_t*)&u))) return(0); fmt_ulong(s, 1900 +t->tm_year); s[4] ='-'; fmt_uint0(&s[5], t->tm_mon +1, 2); s[7] ='-'; fmt_uint0(&s[8], t->tm_mday, 2); |