aboutsummaryrefslogtreecommitdiffstats
path: root/util/miscutil.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1998-04-02 10:30:03 +0000
committerWerner Koch <[email protected]>1998-04-02 10:30:03 +0000
commit303b1084d51dd1f9d3e614497f180a66744f5185 (patch)
tree3e482ba03967ff3f324184e19ecc91016ce4b939 /util/miscutil.c
parentsome cleanups (diff)
downloadgnupg-303b1084d51dd1f9d3e614497f180a66744f5185.tar.gz
gnupg-303b1084d51dd1f9d3e614497f180a66744f5185.zip
release 0.2.14
Diffstat (limited to '')
-rw-r--r--util/miscutil.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/util/miscutil.c b/util/miscutil.c
index cad89e8ab..3bdc68a21 100644
--- a/util/miscutil.c
+++ b/util/miscutil.c
@@ -32,6 +32,24 @@ make_timestamp()
return time(NULL);
}
+u32
+add_days_to_timestamp( u32 stamp, u16 days )
+{
+ return stamp + days*86400L;
+}
+
+const char *
+strtimestamp( u32 stamp )
+{
+ static char buffer[11+5];
+ struct tm *tp;
+ time_t atime = stamp;
+
+ tp = gmtime( &atime );
+ sprintf(buffer,"%04d-%02d-%02d",
+ 1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday );
+ return buffer;
+}
/****************
* Print a string to FP, but filter all control characters out.