|
|
1.1 ! root 1: /* ! 2: * sysdt ! 3: * ! 4: * at exit, xl points to a pseudo-scblk containing the date ! 5: */ ! 6: ! 7: #include <time.h> ! 8: #include "inter.h" ! 9: ! 10: sysdt() ! 11: { ! 12: long tod; ! 13: register struct tm *tm; ! 14: struct tm *localtime(); ! 15: register char *p; ! 16: ! 17: time (&tod); ! 18: tm = localtime (&tod); ! 19: ! 20: conv (tempstr.s, tm->tm_mon+1); ! 21: tempstr.s[2] = '/'; ! 22: conv (tempstr.s+3, tm->tm_mday); ! 23: tempstr.s[5] = '/'; ! 24: conv (tempstr.s+6, tm->tm_year); ! 25: tempstr.s[8] = ' '; ! 26: conv (tempstr.s+9, tm->tm_hour); ! 27: tempstr.s[11] = '.'; ! 28: conv (tempstr.s+12, tm->tm_min); ! 29: tempstr.s[14] = '.'; ! 30: conv (tempstr.s+15, tm->tm_sec); ! 31: tempstr.len = 17; ! 32: SET_XL(&tempstr); ! 33: return 0; ! 34: } ! 35: ! 36: static ! 37: conv (dest, value) ! 38: ! 39: register char *dest; ! 40: register int value; ! 41: ! 42: { ! 43: dest[1] = value % 10 + '0'; ! 44: dest[0] = value / 10 + '0'; ! 45: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.