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_getdate( struct dosdate_t *date );

    struct dosdate_t {
            unsigned char day;      /* 1-31 */
            unsigned char month;    /* 1-12 */
            unsigned short year;    /* 1980-2099 */
            unsigned char dayofweek;/* 0-6 (0=Sunday) */
    };

Description:
    The _dos_getdate function uses system call 0x2A to get the current
    system date.  The date information is returned in a  dosdate_t structure
    pointed to by date.

Returns:
    The _dos_getdate 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_gettime, _dos_setdate, _dos_settime, gmtime, localtime, mktime,
    time

See Also: _dos_gettime _dos_setdate

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