Added my_asctime()

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1114 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-01-14 18:16:39 +00:00 committed by cras
commit 93ba91b8ed
6 changed files with 27 additions and 60 deletions

View file

@ -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;
}

View file

@ -71,4 +71,7 @@ int dec2octal(int decimal);
/* convert all low-ascii (<32) to ^<A..> combinations */
char *show_lowascii(const char *channel);
/* Get time in human readable form with localtime() + asctime() */
char *my_asctime(time_t t);
#endif