<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # C 標準庫 - &lt;time.h&gt; ## 簡介 **time.h** 頭文件定義了四個變量類型、兩個宏和各種操作日期和時間的函數。 ## 庫變量 下面是頭文件 time.h 中定義的變量類型: | 變量 | 描述 | | --- | --- | | **size_t** | 是無符號整數類型,它是 **sizeof** 關鍵字的結果。 | | **clock_t** | 這是一個適合存儲處理器時間的類型。 | | **time_t is** | 這是一個適合存儲日歷時間類型。 | | **struct tm** | 這是一個用來保存時間和日期的結構。 | tm 結構的定義如下: ``` struct tm { int tm_sec; /* 秒,范圍從 0 到 59 */ int tm_min; /* 分,范圍從 0 到 59 */ int tm_hour; /* 小時,范圍從 0 到 23 */ int tm_mday; /* 一月中的第幾天,范圍從 1 到 31 */ int tm_mon; /* 月,范圍從 0 到 11 */ int tm_year; /* 自 1900 年起的年數 */ int tm_wday; /* 一周中的第幾天,范圍從 0 到 6 */ int tm_yday; /* 一年中的第幾天,范圍從 0 到 365 */ int tm_isdst; /* 夏令時 */ }; ``` ## 庫宏 下面是頭文件 time.h 中定義的宏: | 宏 | 描述 | | --- | --- | | **NULL** | 這個宏是一個空指針常量的值。 | | **CLOCKS_PER_SEC** | 這個宏表示每秒的處理器時鐘個數。 | ## 庫函數 下面是頭文件 time.h 中定義的函數: | 函數 | 描述 | | --- | --- | | [char \*asctime(const struct tm \*timeptr)](c-function-asctime.html) | 返回一個指向字符串的指針,它代表了結構 timeptr 的日期和時間。 | | [clock_t clock(void)](c-function-clock.html) | 返回程序執行起(一般為程序的開頭),處理器時鐘所使用的時間。 | | [char \*ctime(const time_t \*timer)](c-function-ctime.html) | 返回一個表示當地時間的字符串,當地時間是基于參數 timer。 | | [double difftime(time_t time1, time_t time2)](c-function-difftime.html) | 返回 time1 和 time2 之間相差的秒數 (time1-time2)。 | | [struct tm \*gmtime(const time_t \*timer)](c-function-gmtime.html) | timer 的值被分解為tm 結構,并用協調世界時(UTC)也被稱為格林尼治標準時間(GMT)表示。 | | [struct tm \*localtime(const time_t \*timer)](c-function-localtime.html) | timer 的值被分解為tm 結構,并用本地時區表示。 | | [time_t mktime(struct tm \*timeptr)](c-function-mktime.html) | 把 timeptr 所指向的結構轉換為一個依據本地時區的 time_t 值。 | | [size_t strftime(char \*str, size_t maxsize, const char \*format, const struct tm \*timeptr)](c-function-strftime.html) | 根據 format 中定義的格式化規則,格式化結構 timeptr 表示的時間,并把它存儲在 str 中。 | | [time_t time(time_t \*timer)](c-function-time.html) | 計算當前日歷時間,并把它編碼成 time_t 格式。 |
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看