home *** CD-ROM | disk | FTP | other *** search
- /*--------------------------------------*/
- /* */
- /* SETTDATE(X) */
- /* */
- /* Functionality: */
- /* Sets the system's date to the */
- /* argument given. The argument */
- /* is in the form "MM/DD/YY". */
- /* Arguments: */
- /* 0: The date to be set. */
- /* Returns: Nothing */
- /* Author: John Callicotte */
- /* Date created/modified: 08/31/88 */
- /* */
- /*--------------------------------------*/
-
- # include "dos.h"
- # include "stdlib.h"
- void settdate(r)
- char r[8];
- {
- struct date dait;
- char s[3];
- int j;
- for (j=0;j<2;j++) /* Pull in the month from the */
- s[j]=r[j]; /* argument, convert it to an */
- s[2]=0; /* integer, and put it in the */
- dait.da_mon=atoi(s); /* structure for setdate(). */
-
- for (j=0;j<2;j++) /* Ditto for the day */
- s[j]=r[j+3];
- s[2]=0;
- dait.da_day=atoi(s);
-
- for (j=0;j<2;j++) /* Ditto for the year */
- s[j]=r[j+6];
- s[2]=0;
- dait.da_year=atoi(s)+1900;
- setdate(&dait); /* Call the Turbo C function that */
- /* sets the system date. */
- }