Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_dos_gettime() get system time</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _dos_gettime()          Get system time

 #include   <dos.h>

  void    _dos_gettime(time);
  struct dostime_t *time;     Location of information about new time

    _dos_gettime() uses MS-DOS function 2Ch to get the current system
    time.  The time is returned in struct dostime_t, defined in dos.h:

           struct dostime_t {
              unsigned char hour;       0-23
              unsigned char minute;     0-59
              unsigned char second;     0-59
              unsigned char hsecond;    0-99 (hundreths of a second)
              }

   Portability:     MS-DOS only, version 1.0 or higher

------------------------------- Example ---------------------------------

 This program gets the current system time

           #include <dos.h>

           main()
           {
              struct dostime_t time;

              _dos_gettime(&time);
             printf("The current system time is %d:%d:%d:%d\n",
                     time.hour, time.minute, time.second, time.hsecond);
           }


See Also: _dos_settime() _dos_getdate()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson