比如设置现在时间为2007年5月27日17点06分23秒
adjustdate(2007,5,27,17,06,23);
void adjustdate(int year,int mon,int mday,int hour,int min,int sec )
{
time_t t;
struct tm nowtime ;
nowtime.tm_sec=sec; /* Seconds.[0-60] (1 leap second)*/
nowtime.tm_min=min; /* Minutes.[0-59] */
nowtime.tm_hour=hour; /* Hours. [0-23] */
nowtime.tm_mday=mday; /* Day.[1-31] */
nowtime.tm_mon=mon-1; /* Month. [0-11] */
nowtime.tm_year=year-1900; /* Year- 1900.*/
nowtime.tm_isdst=-1; /* DST.[-1/0/1]*/
t=mktime(&nowtime);
stime(&t);
}