17 lines
436 B
C
17 lines
436 B
C
#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 );
|
|
}
|