home *** CD-ROM | disk | FTP | other *** search
- /* TIMECHK.C - Sets the DOS errorlevel to the hour + 200. */
-
- #include <stdio.h>
- #include <dos.h>
-
- main()
- {
- struct time dostime;
- int errorlevel;
-
- errorlevel = 0;
- gettime(&dostime);
-
- errorlevel = (dostime.ti_hour * 10) + (dostime.ti_min / 10);
-
- printf("\nThe time is %02d:%02d:%02d\n",
- dostime.ti_hour, dostime.ti_min, dostime.ti_sec);
- printf("Errorlevel = %03d\n", errorlevel );
-
- exit(errorlevel);
- }