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 Library Reference - <u>synopsis:</u> 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.

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, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32, DOS/PM

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

See Also: _dos_getdate _dos_setdate

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