home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / BTMTSRC3.ZIP / DOSTIME.C < prev    next >
C/C++ Source or Header  |  1991-07-19  |  940b  |  37 lines

  1. #include <stdio.h>
  2.  
  3.  
  4. #include <stdio.h>
  5. #ifndef OS_2
  6. #error  This Module only for OS/2
  7. #endif
  8.  
  9. #define INCL_DOSDATETIME
  10. #include <os2.h>
  11.  
  12.  
  13.  
  14. void dostime(int *hour, int *min, int *sec, int *hdths)
  15.     {
  16.     DATETIME dt;
  17.     
  18.     DosGetDateTime(&dt);
  19.     *hour      = dt.hours;                        /* current hour */
  20.     *min       = dt.minutes;                      /* current minute */
  21.     *sec       = dt.seconds;                      /* current second */
  22.     *hdths     = dt.hundredths;                   /* current hundredths of a second */
  23.     }
  24.  
  25.  
  26.  
  27. void dosdate(int *month, int *mday, int *year, int *weekday)
  28.     {
  29.     DATETIME dt;
  30.  
  31.     DosGetDateTime(&dt);
  32.     *mday      = dt.day;                          /* current day */
  33.     *month     = dt.month;                        /* current month */
  34.     *year      = dt.year;                         /* current year */
  35.     *weekday   = dt.weekday;                      /* current day of week */
  36.     }
  37.