Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <dos.h>
    void _dos_gettime( struct dostime_t *time );

    struct dostime_t {
            unsigned char hour;     /* 0-23 */
            unsigned char minute;   /* 0-59 */
            unsigned char second;   /* 0-59 */
            unsigned char hsecond;  /* 1/100 second; 0-99 */
    };

Description:
    The _dos_gettime function uses system call 0x2C to get the current
    system time.  The time information is returned in a  dostime_t structure
    pointed to by time.

Returns:
    The _dos_gettime function has no return value.

See Also:
    _dos_getdate, _dos_setdate, _dos_settime, gmtime Functions, localtime Functions, mktime,
    time

Example:
    #include <stdio.h>
    #include <dos.h>

    void main()
      {
        struct dosdate_t date;
        struct dostime_t time;

        /* Get and display the current date and time */
        _dos_getdate( &date );
        _dos_gettime( &time );
        printf( "The date (MM-DD-YYYY) is: %d-%d-%d\n",
            date.month, date.day, date.year );
        printf( "The time (HH:MM:SS) is: %.2d:%.2d:%.2d\n",
            time.hour, time.minute, time.second );
      }

    produces the following:

    The date (MM-DD-YYYY) is: 12-25-1989
    The time (HH:MM:SS) is: 14:23:57

Classification:
    DOS

Systems:
    DOS, Win, OS/2 1.x(all), OS/2 2.x, NT, DOS/PM

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