struct tm * times
time_t定時器;
時間(& amp定時器);
int leap
times=localtime。定時器);
他們的結構
結構商標
{
int tm _ sec//當前秒
int tm _ min//當前分鐘
int tm _ hour//當前小時
int tm _ mday//本月的當前日,如10月的11日,為1。
int tm _ mon//當前月份,範圍為0~11。
int tm _ year//當前年份與1900的差值,如2006年為36。
int tm _ wday//當前星期幾,範圍從0到6。
int tm _ yday//今年的當前天數,範圍從0到365。
int tm _ isdst//這個我也不知道
}
int getSystemTime()
{
time_t定時器;
struct tm * t _ tm
時間(& amp定時器);
t _ TM = local time(& amp;定時器);
printf("今天是%4d%02d%02d%02d%02d%02d
“,t_tm.tm_year+1900,
t_tm.tm_mon+1,t_tm.tm_mday,t_tm.tm_hour
t_tm.tm_min,t _ TM . TM _ sec);
返回0;
}