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