Annotation of researchv10no/cmd/upas/libc/s5date.c, revision 1.1

1.1     ! root        1: #include <sys/types.h>
        !             2: #include <time.h>
        !             3: 
        !             4: extern long time();
        !             5: extern void tzset();
        !             6: extern char *tzname[];
        !             7: 
        !             8: /*
        !             9:  *  return an ascii daytime string
        !            10:  */
        !            11: extern char *
        !            12: thedate()
        !            13: {
        !            14:        static char date[32];
        !            15:        char *tp, *dp;
        !            16:        struct tm *bp;
        !            17:        long thetime;
        !            18: 
        !            19:        thetime = time((long *)0);
        !            20:        tzset();
        !            21:        bp = localtime(&thetime);
        !            22:        dp = asctime(bp);
        !            23:        tp = bp->tm_isdst ? tzname[1] : tzname[0];
        !            24:        sprintf(date, "%.16s %.3s %.4s", dp, tp, dp+20);
        !            25:        return date;
        !            26: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.