home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * DATE.C
- */
-
- #include <string.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include "config.h"
-
- Prototype char *atime(time_t *);
-
- char *
- atime(pt)
- time_t *pt;
- {
- static char buf[40];
- static char *mo[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
- };
- static char *dow[7] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
- static char *TimeZoneName;
- struct tm *ut = localtime(pt);
-
- if (TimeZoneName == NULL)
- TimeZoneName = FindConfig("TimeZone");
-
- sprintf(buf, "%s, %d %s %02d %02d:%02d:%02d %s",
- dow[ut->tm_wday], ut->tm_mday, mo[ut->tm_mon],
- ut->tm_year % 100, ut->tm_hour, ut->tm_min, ut->tm_sec,
- TimeZoneName
- );
- return(buf);
- }
-
-