/* * date: show the date */ #if GEMDOS #include char * istime() { static char tmbuf[20]; struct { int hour; int minute; int day; int month; int year; } hacktm; unsigned time, date; time = Tgettime(); date = Tgetdate(); hacktm.year =((date&0xFE00) >> 9)+80; hacktm.month = (date&0x01E0) >> 5; hacktm.day = (date&0x001F); hacktm.hour = (time&0xF800)>> 11; hacktm.minute= (time&0x07E0)>> 5; sprintf(tmbuf, "%02d%02d %02d%02d%02d", hacktm.hour, hacktm.minute, hacktm.day, hacktm.month, hacktm.year); return tmbuf; } /* istime() */ #endif #if OS2 #include #undef MSDOS char * istime() { DATETIME now; static char tmbuf[20]; DosGetDateTime(&now); sprintf(tmbuf, "%02d%02d %02d%02d%02d", now.hours, now.minutes, now.day, now.month, now.year); return tmbuf; } /* istime() */ #endif #if MSDOS #include char * istime() { struct dosdate_t today; struct dostime_t now; static char tmbuf[20]; _dos_getdate(&today); _dos_gettime(&now); sprintf(tmbuf, "%02d%02d %02d%02d%02d", now.hour, now.minute, today.day, today.month, today.year); return tmbuf; } /* istime() */ #endif