/*****
                              dateset()

      This function sets the system date using interrupt 0x21. The date
   must fall between 1980 and 2099.

   Argument list:    int day        the day
                     int month      the month
                     int year       the year

   Return value:     int            0 if successful, 0xff if not

*****/

#include <dos.h>

int dateset(int day, int month, int year)
{
   union REGS ireg;

   ireg.h.ah = 0x2b;
   ireg.h.dl = day;
   ireg.h.dh = month;
   ireg.x.cx = year;
   intdos(&ireg, &ireg);
   return (ireg.h.al);
}
