diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/Makefile.am | 2 | ||||
-rw-r--r-- | util/Makefile.in | 2 | ||||
-rw-r--r-- | util/miscutil.c | 18 |
3 files changed, 20 insertions, 2 deletions
diff --git a/util/Makefile.am b/util/Makefile.am index e8f920f84..df60fbb64 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -INCLUDES = -I$(top_srcdir)/include +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl -I../intl noinst_LIBRARIES = libutil.a diff --git a/util/Makefile.in b/util/Makefile.in index 75e1d82e6..025ea3f8e 100644 --- a/util/Makefile.in +++ b/util/Makefile.in @@ -92,7 +92,7 @@ VERSION = @VERSION@ ZLIBS = @ZLIBS@ l = @l@ -INCLUDES = -I$(top_srcdir)/include +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl -I../intl noinst_LIBRARIES = libutil.a 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. |