Annotation of 42BSD/usr.lib/libU77/idate_.c, revision 1.1

1.1     ! root        1: /*
        !             2: char id_idate[] = "@(#)idate_.c        1.2";
        !             3:  *
        !             4:  * return date in numerical form
        !             5:  *
        !             6:  * calling sequence:
        !             7:  *     integer iarray(3)
        !             8:  *     call idate(iarray)
        !             9:  * where:
        !            10:  *     iarray will receive the current date; day, mon, year.
        !            11:  */
        !            12: 
        !            13: #include <sys/types.h>
        !            14: #include <sys/time.h>
        !            15: 
        !            16: idate_(iar)
        !            17: struct { long iday; long imon; long iyer; } *iar;
        !            18: {
        !            19:        struct tm *localtime(), *lclt;
        !            20:        long int time(), t;
        !            21: 
        !            22:        t = time(0);
        !            23:        lclt = localtime(&t);
        !            24:        iar->iday = lclt->tm_mday;
        !            25:        iar->imon = lclt->tm_mon + 1;
        !            26:        iar->iyer = lclt->tm_year + 1900;
        !            27: }

unix.superglobalmegacorp.com

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