mirror of
https://github.com/irssi/irssi.git
synced 2026-08-18 08:02:13 +02:00
Added my_asctime()
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1114 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
d427f74143
commit
93ba91b8ed
6 changed files with 27 additions and 60 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue