summaryrefslogtreecommitdiffstats
path: root/common/gettime.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2006-05-23 18:19:43 +0200
committerWerner Koch <wk@gnupg.org>2006-05-23 18:19:43 +0200
commitfbe4ac37f6d3e7870e26caffb0d21c3c77198297 (patch)
treef21028be87bda6df4f2f1e3ae105feeb5a2eb158 /common/gettime.c
parent2006-05-19 Marcus Brinkmann <marcus@g10code.de> (diff)
downloadgnupg2-fbe4ac37f6d3e7870e26caffb0d21c3c77198297.tar.xz
gnupg2-fbe4ac37f6d3e7870e26caffb0d21c3c77198297.zip
g10/ does build again.
Diffstat (limited to 'common/gettime.c')
-rw-r--r--common/gettime.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/common/gettime.c b/common/gettime.c
index 93e4ba113..ecdc7df95 100644
--- a/common/gettime.c
+++ b/common/gettime.c
@@ -201,7 +201,7 @@ strtimevalue( u32 value )
}
-/****************
+/*
* Note: this function returns GMT
*/
const char *
@@ -222,6 +222,32 @@ strtimestamp( u32 stamp )
return buffer;
}
+
+/*
+ * Note: this function returns GMT
+ */
+const char *
+isotimestamp (u32 stamp)
+{
+ static char buffer[25+5];
+ struct tm *tp;
+ time_t atime = stamp;
+
+ if (atime < 0)
+ {
+ strcpy (buffer, "????" "-??" "-??" " " "??" ":" "??" ":" "??");
+ }
+ else
+ {
+ tp = gmtime ( &atime );
+ sprintf (buffer,"%04d-%02d-%02d %02d:%02d:%02d",
+ 1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday,
+ tp->tm_hour, tp->tm_min, tp->tm_sec);
+ }
+ return buffer;
+}
+
+
/****************
* Note: this function returns local time
*/