From 93ba91b8ed23284cfe14f5d77d5910e112039424 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 14 Jan 2001 18:16:39 +0000 Subject: Added my_asctime() git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1114 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/misc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/core/misc.c') diff --git a/src/core/misc.c b/src/core/misc.c index 2363eee7..0ae36b96 100644 --- a/src/core/misc.c +++ b/src/core/misc.c @@ -591,3 +591,17 @@ char *show_lowascii(const char *channel) return str; } +/* Get time in human readable form with localtime() + asctime() */ +char *my_asctime(time_t t) +{ + struct tm *tm; + char *str; + int len; + + tm = localtime(&t); + str = g_strdup(asctime(tm)); + + len = strlen(str); + if (len > 0) str[len-1] = '\0'; + return str; +} -- cgit v1.2.3