取得某個(gè)目錄下面所有文件
取得文件的創(chuàng)建日期
取得當(dāng)前日期跟其創(chuàng)建的日期差
刪除文件
時(shí)間的轉(zhuǎn)換
struct tm { int tm_sec; /*秒,0-59*/ int tm_min; /*分,0-59*/ int tm_hour; /*時(shí),0-23*/ int tm_mday; /*天數(shù),1-31*/ int tm_mon; /*月數(shù),0-11*/ int tm_year; /*自1900的年數(shù)*/ int tm_wday; /*自星期日的天數(shù)0-6*/ int tm_yday; /*自1月1日起的天數(shù),0-365*/ int tm_isdst; /*是否采用夏時(shí)制,采用為正數(shù)*/ }日期貯存結(jié)構(gòu)date
struct date { int da_year; /*自1900的年數(shù)*/ char da_day; /*天數(shù)*/ char da_mon; /*月數(shù) 1=Jan*/ }時(shí)間貯存結(jié)構(gòu)time
struct time { unsigned char ti_min; /*分鐘*/ unsigned char ti_hour; /*小時(shí)*/ unsigned char ti_hund; unsigned char ti_sec; /*秒*/ }char *ctime(long *clock)本函數(shù)把clock所指的時(shí)間(如由函time返回的時(shí)間)轉(zhuǎn)換成數(shù)下列格式的字符串:Mon Nov 21 11:31:54 1983nchar asctime(struct tm *tm)本函數(shù)把指定的tm結(jié)構(gòu)類的時(shí)間轉(zhuǎn)換成下列格式的字符串:Mon Nov 21 11:31:54 1983ndouble difftime(time_t time2,time_t time1)計(jì)算結(jié)構(gòu)time2和time1之間的時(shí)間差距(以秒為單位)struct tm *gmtime(long *clock)本函數(shù)把clock所指的時(shí)間(如由函數(shù)time返回的時(shí)間)轉(zhuǎn)換成格林威治時(shí)間,并以tm結(jié)構(gòu)形式返回struct tm *localtime(long *clock)本函數(shù)把clock所指的時(shí)間(如函數(shù)time返回的時(shí)間)轉(zhuǎn)換成當(dāng)?shù)貥?biāo)準(zhǔn)時(shí)間,并以tm結(jié)構(gòu)形式返回void tzset()本函數(shù)提供了對(duì)UNIX操作系統(tǒng)的兼容性long dostounix(struct date *dateptr,struct time *timeptr)本函數(shù)將dateptr所指的日期,timeptr所指的時(shí)間轉(zhuǎn)換成UNIX格式, 并返回自格林威治時(shí)間1970年1月1日凌晨起到現(xiàn)在的秒數(shù)void unixtodos(long utime,struct date *dateptr,struct time *timeptr)本函數(shù)將自格林威治時(shí)間1970年1月1日凌晨起到現(xiàn)在的秒數(shù)utime轉(zhuǎn)換成DOS格式并保存于用戶所指的結(jié)構(gòu)dateptr和timeptr中void getdate(struct date *dateblk)本函數(shù)將計(jì)算機(jī)內(nèi)的日期寫(xiě)入結(jié)構(gòu)dateblk中以供用戶使用void setdate(struct date *dateblk)本函數(shù)將計(jì)算機(jī)內(nèi)的日期改成由結(jié)構(gòu)dateblk所指定的日期void gettime(struct time *timep)本函數(shù)將計(jì)算機(jī)內(nèi)的時(shí)間寫(xiě)入結(jié)構(gòu)timep中, 以供用戶使用void settime(struct time *timep)本函數(shù)將計(jì)算機(jī)內(nèi)的時(shí)間改為由結(jié)構(gòu)timep所指的時(shí)間long time(long *tloc)本函數(shù)給出自格林威治時(shí)間1970年1月1日凌晨至現(xiàn)在所經(jīng)過(guò)的秒數(shù),并將該值存于tloc所指的單元中. int stime(long *tp)本函數(shù)將tp所指的時(shí)間(例如由time所返回的時(shí)間)寫(xiě)入計(jì)算機(jī)中.參考網(wǎng)址
|
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注