home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / SYS / FTIME.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  592 b   |  26 lines

  1. /* sys/ftime.c (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes */
  2.  
  3. #include <sys/emx.h>
  4. #include <os2emx.h>
  5. #include <sys/timeb.h>
  6. #include <time.h>
  7. #include "syscalls.h"
  8.  
  9. void __ftime (struct timeb *ptr)
  10. {
  11.   DATETIME now;
  12.   struct tm tm;
  13.  
  14.   DosGetDateTime (&now);
  15.   tm.tm_sec = now.seconds;
  16.   tm.tm_min = now.minutes;
  17.   tm.tm_hour = now.hours;
  18.   tm.tm_mday = now.day;
  19.   tm.tm_mon = now.month - 1;
  20.   tm.tm_year = now.year - 1900;
  21.   ptr->time = (time_t)_mktime (&tm);
  22.   ptr->millitm = now.hundredths * 10;
  23.   ptr->timezone = now.timezone;
  24.   ptr->dstflag = 0;
  25. }
  26.