home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / MNUM416D.SZH / DOSTIME.C < prev    next >
Text File  |  1991-03-24  |  820b  |  31 lines

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