summaryrefslogtreecommitdiff
path: root/sysdep/unix/io.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-03-12 22:43:13 +0000
committerMartin Mares <mj@ucw.cz>2000-03-12 22:43:13 +0000
commit7a88832e78cbc18db109c091d74f6d27284cff44 (patch)
treeaf0ea68f93cef7f9a5ae1d2d94ffee975947e809 /sysdep/unix/io.c
parent81ce667b7b7c38e109984602cf4e5ecbec80f7f1 (diff)
Added tm_format_datetime().
Diffstat (limited to 'sysdep/unix/io.c')
-rw-r--r--sysdep/unix/io.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index f8603070..267e5896 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -293,6 +293,16 @@ tm_format_date(char *x, bird_clock_t t)
}
void
+tm_format_datetime(char *x, bird_clock_t t)
+{
+ struct tm *tm;
+
+ tm = localtime(&t);
+ if (strftime(x, TM_DATETIME_BUFFER_SIZE, "%d-%m-%Y %H:%M:%S", tm) == TM_DATETIME_BUFFER_SIZE)
+ strcpy(x, "<too-long>");
+}
+
+void
tm_format_reltime(char *x, bird_clock_t t)
{
struct tm *tm;