函数名: getdate
功 能: 取DOS日期
用 法: void getdate(struct *dateblk);
程序例:
#include<stdio.h>
#include <dos.h>
int main(void)
{
struct date d;
getdate(&d);
printf("The current year is: %d\",
d.da_year);
printf("The current day is: %d\",
d.da_day);
printf("The current month is: %d\",
d.da_mon);
return 0;
}
备注
在VC++6.0中运行上述程序不能通过,原因是此版本的<dos.h>中不包含getdate函数。
但在TroboC 中运行可以通过。