|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1980 Regents of the University of California. ! 3: * All rights reserved. The Berkeley software License Agreement ! 4: * specifies the terms and conditions for redistribution. ! 5: * ! 6: * @(#)idate_.c 5.1 6/7/85 ! 7: */ ! 8: ! 9: /* ! 10: * return date in numerical form ! 11: * ! 12: * calling sequence: ! 13: * integer iarray(3) ! 14: * call idate(iarray) ! 15: * where: ! 16: * iarray will receive the current date; day, mon, year. ! 17: */ ! 18: ! 19: #include <sys/types.h> ! 20: #include <sys/time.h> ! 21: ! 22: idate_(iar) ! 23: struct { long iday; long imon; long iyer; } *iar; ! 24: { ! 25: struct tm *localtime(), *lclt; ! 26: long int time(), t; ! 27: ! 28: t = time(0); ! 29: lclt = localtime(&t); ! 30: iar->iday = lclt->tm_mday; ! 31: iar->imon = lclt->tm_mon + 1; ! 32: iar->iyer = lclt->tm_year + 1900; ! 33: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.