home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name qysetdat -- Set the system date
- *
- * Synopsis ercode = qysetdat(year,month,day);
- *
- * int ercode 1 if the date is invalid, 0 otherwise
- * int year The year (1980 - 2099) to set
- * int month The month (1 - 12) to set
- * int day The day (1 - 31) to set
- *
- * Description QYSETDAT sets the system date to the values specified.
- * If the format is invalid, the error code is returned
- * with a value of 1; otherwise zero. Note that only the
- * ranges listed above are checked. Setting the day to 31
- * for the month of June, for example, is an error not
- * caught.
- *
- * Returns ercode 1 if the date is invalid, 0 otherwise
- *
- * Version 3.0 (C)Copyright Blaise Computing Inc. 1983, 1984, 1986
- *
- **/
-
- #include <bquery.h>
-
- int qysetdat(year,month,day)
- int year,month,day;
- {
- DOSREG dos_reg;
-
- dos_reg.ax = 0x2b00;
- dos_reg.cx = year;
- dos_reg.dx = utbyword(month,day);
- dos(&dos_reg);
-
- if (utlobyte(dos_reg.ax))
- return(1);
-
- return(0);
- }