home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 463.lha / Date_routines / dateset.c < prev    next >
C/C++ Source or Header  |  1991-01-04  |  584b  |  28 lines

  1. /*****
  2.                               dateset()
  3.  
  4.       This function sets the system date using interrupt 0x21. The date
  5.    must fall between 1980 and 2099.
  6.  
  7.    Argument list:    int day        the day
  8.                      int month      the month
  9.                      int year       the year
  10.  
  11.    Return value:     int            0 if successful, 0xff if not
  12.  
  13. *****/
  14.  
  15. #include <dos.h>
  16.  
  17. int dateset(int day, int month, int year)
  18. {
  19.    union REGS ireg;
  20.  
  21.    ireg.h.ah = 0x2b;
  22.    ireg.h.dl = day;
  23.    ireg.h.dh = month;
  24.    ireg.x.cx = year;
  25.    intdos(&ireg, &ireg);
  26.    return (ireg.h.al);
  27. }
  28.