Files
amiga-tz/asctime.c
T

45 lines
815 B
C
Raw Normal View History

1986-12-31 14:22:18 -05:00
#
/*LINTLIBRARY*/
#include "stdio.h"
#ifndef lint
#ifndef NOID
static char sccsid[] = "%W%";
#endif /* !NOID */
#endif /* !lint */
#include "time.h"
1986-12-31 16:13:33 -05:00
#include "tzfile.h"
1986-12-31 14:22:18 -05:00
#ifndef USG
extern char * sprintf();
#endif /* !USG */
/*
** A la X3J11
*/
char *
asctime(timeptr)
register struct tm * timeptr;
{
1987-01-01 13:39:00 -05:00
static char wday_name[DAYS_PER_WEEK][3] = {
1986-12-31 14:22:18 -05:00
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
1987-01-01 13:39:00 -05:00
static char mon_name[MONS_YER_YEAR][3] = {
1986-12-31 14:22:18 -05:00
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
static char result[26];
(void) sprintf(result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n",
wday_name[timeptr->tm_wday],
mon_name[timeptr->tm_mon],
timeptr->tm_mday, timeptr->tm_hour,
timeptr->tm_min, timeptr->tm_sec,
TM_YEAR_BASE + timeptr->tm_year);
return result;
}