79 |
|
* Thu Nov 24 18:22:48 1986 |
80 |
|
*/ |
81 |
|
const char * |
82 |
< |
myctime(time_t lclock) |
82 |
> |
date_ctime(time_t lclock) |
83 |
|
{ |
84 |
|
static char buf[MAX_DATE_STRING]; |
85 |
|
static time_t lclock_last; |
86 |
– |
char *p; |
86 |
|
|
87 |
|
if (!lclock) |
88 |
|
lclock = CurrentTime; |
89 |
|
|
90 |
< |
if (lclock_last == lclock) |
91 |
< |
return buf; |
90 |
> |
if (lclock_last != lclock) |
91 |
> |
{ |
92 |
> |
lclock_last = lclock; |
93 |
> |
strftime(buf, sizeof(buf), "%a %b %-e %T %Y", localtime(&lclock)); |
94 |
> |
} |
95 |
|
|
94 |
– |
lclock_last = lclock; |
95 |
– |
strlcpy(buf, ctime(&lclock), sizeof(buf)); |
96 |
– |
|
97 |
– |
if ((p = strchr(buf, '\n'))) |
98 |
– |
*p = '\0'; |
96 |
|
return buf; |
97 |
|
} |
98 |
|
|