|
<time.h> 時(shí)間和日期函數(shù)- <time.h> 是C標(biāo)準(zhǔn)函數(shù)庫中獲取時(shí)間與日期、對時(shí)間與日期數(shù)據(jù)操作及格式化的頭文件。
宏:
- NULL null是一個(gè)null指針常量的值
- CLOCKS_PER_SEC 每秒的時(shí)鐘數(shù)
- 變量:
- typedef size_t 類型定義
- typedef clock_t類型定義
- struct tm 結(jié)構(gòu)體
struct tm { int tm_sec; /* 秒 – 取值區(qū)間為[0,59] */
int tm_min; /* 分 - 取值區(qū)間為[0,59] */
int tm_hour; /* 時(shí) - 取值區(qū)間為[0,23] */
int tm_mday; /* 一個(gè)月中的日期 - 取值區(qū)間為[1,31] */
int tm_mon; /* 月份(從一月開始,0代表一月) - 取值區(qū)間為[0,11] */
int tm_year; /* 年份,其值等于實(shí)際年份減去1900 */
int tm_wday; /* 星期 – 取值區(qū)間為[0,6],其中0代表星期天,1代表星期一,以此類推 */
int tm_yday; /* 從每年的1月1日開始的天數(shù) – 取值區(qū)間為[0,365],其中0代表1月1日,1代表1月2日,以此類推 */
int tm_isdst; /* 夏令時(shí)標(biāo)識(shí)符,實(shí)行夏令時(shí)的時(shí)候,tm_isdst為正。不實(shí)行夏令時(shí)的進(jìn)候,tm_isdst為0;不了解情況時(shí),tm_isdst()為負(fù)。*/ };
- 函數(shù):
|