_dos_gettime

Description

Gets the current system time, using system call 0x2C.

#include <dos.h>

void _dos_gettime( struct _dostime_t *time );

time Current system time  

Remarks

The _dos_gettime routine uses system call 0x2C to obtain the current system time. The time is returned in a _dostime_t structure, defined in DOS.H.

The dostime_t structure contains the following elements:

Element Description

unsigned char hour 0–23
unsigned char minute 0–59
unsigned char second 0–59
unsigned char hsecond 1/100 second; 0–99

Return Value

None.

Compatibility

Standards:None

16-Bit:DOS, QWIN, WIN, WIN DLL

32-Bit:None

See Also

_dos_getdate, _dos_setdate, _dos_settime, gmtime, localtime, _strtime

Example

/* DGTIME.C: This program gets and displays current date and time values. */

#include <stdio.h>

#include <dos.h>

void main( void )

{

struct _dosdate_t date;

struct _dostime_t time;

/* Get current date and time values */

_dos_getdate( &date );

_dos_gettime( &time );

printf( “Today's date is %d-%d-%d\n”, date.month, date.day, date.year );

printf( “The time is %02d:%02d\n”, time.hour, time.minute );

}

Output

Today's date is 12-15-1999

The time is 18:07