home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / c / c_tutor / c_1 / dosdate < prev    next >
Encoding:
Text File  |  1992-11-14  |  428 b   |  21 lines

  1. #include <dos.h>
  2. dosdate(date)
  3. char date[];
  4. {
  5.         char mon[3],
  6.                  day[3],
  7.                  yy[5];
  8.         union REGS DREG;
  9.         DREG.h.ah=0x2a;
  10.         intdos(&DREG.h,&DREG.h);
  11.         stcu_d(mon,DREG.h.dh,3);
  12.         stcu_d(day,DREG.h.dl,3);
  13.         stcu_d(yy,DREG.x.cx,5);
  14.         strcpy(date,mon);
  15.         strcat(date,"-");
  16.         strcat(date,day);
  17.         strcat(date,"-");
  18.         strcat(date,yy);
  19.  
  20. }
  21.