?
? ????? PHP ??? ???? ??? ?? ??
在頭文件<time.h>中定義 | ||
---|---|---|
typedef / * unspecified * / time_t; |
C11標準(ISO / IEC 9899:2011):
7.27.2.5 timespec_get函數(shù)(p:390)
盡管沒有用C標準定義,但它幾乎總是一個整數(shù)值,它保存自1970年1月1日00:00 UTC以來對應(yīng)于POSIX時間的秒數(shù)(不包括閏秒)。
當引用類型的值時,標準使用術(shù)語日歷時間time_t
。
顯示時代的開始。
#include <stdio.h>#include <time.h> int main(void){ time_t epoch = 0; printf("%ld seconds since the epoch began\n", (long)epoch); printf("%s", asctime(gmtime(&epoch)));}
可能的輸出:
0 seconds since the epoch began Thu Jan 1 00:00:00 1970
C11標準(ISO / IEC 9899:2011):
7.27.1 / 3時間分量(p:388)
C99標準(ISO / IEC 9899:1999):
7.23.1 / 3時間的組成部分(p:338)
C89 / C90標準(ISO / IEC 9899:1990):
4.12.1時間的組成部分