NetBSD/libexec/crond/arpadate.c
mycroft aee4b07b8a Add RCS identifiers, remove some completely useless RCS logs and patchkit
headers, and a few other insignificant changes.
1993-08-02 17:48:44 +00:00

32 lines
652 B
C

#ifndef lint
static char rcsid[] = "$Id: arpadate.c,v 1.2 1993/08/02 17:50:20 mycroft Exp $";
#endif /* not lint */
#include <time.h>
#include "cron.h"
/* Sat, 27 Feb 93 11:44:51 CST
* 123456789012345678901234567
*/
char *
arpadate(
time_t *clock
) {
time_t t = clock ?*clock :time();
struct tm *tm = localtime(&t);
static char ret[30]; /* zone name might be >3 chars */
(void) sprintf(ret, "%s, %2d %s %2d %02d:%02d:%02d %s",
DowNames[tm->tm_wday],
tm->tm_mday,
MonthNames[tm->tm_mon],
tm->tm_year,
tm->tm_hour,
tm->tm_min,
tm->tm_sec,
tm->tm_zone);
return ret;
}