需要包含头文件 dos.h
void gettime(struct time *timep);//取时间
void settime(struct time *timep);//设置时间
time结构如下:
struct time {
unsigned char ti_min; /* minutes */
unsigned char ti_hour; /* hours */
unsigned char ti_hund; /* hundredths of seconds */
unsigned char ti_sec; /* seconds */
};
调用例子:
time t1;
gettime(&t1);
cout<<"hour="<
#include
#include
int main() {
cout << system("date") << endl;
return 0;
}