函数名: settime
功 能: 设置系统时间
用 法: void settime(struct time *timep);
程序例:
#include
#include
int main(void)
{
struct time t;
gettime(&t);
printf("The current minute is: %d\n", t.ti_min);
printf("The current hour is: %d\n", t.ti_hour);
printf("The current hundredth of a second is: %d\n", t.ti_hund);
printf("The current second is: %d\n", t.ti_sec);
/* Add one to the minutes struct element and then call settime */
t.ti_min++; //在这个地方就可以控制你要改的时间的分,以此同!
settime(&t);
return 0;
}
◆◆
评论读取中....
请登录后再发表评论!
◆◆
修改失败,请稍后尝试