標準ライブラリヘッダー <ctime>
From cppreference.com
このヘッダーは元々C標準ライブラリの <time.h> でした。
このヘッダーは Cスタイルの日付と時刻 ライブラリの一部です。
マクロ定数 | ||
| 1秒あたりのプロセッサクロックティック数 (マクロ定数) | ||
| 処理系定義のヌルポインタ定数 (マクロ定数) | ||
型 | ||
| プロセス実行時間 (typedef) | ||
| sizeof 演算子が返す符号無し整数型 (typedef) | ||
| エポックからの経過時刻型 (typedef) | ||
| カレンダー時間型 (クラス) | ||
| (C++17) |
秒とナノ秒での時間 (構造体) | |
関数 | ||
時刻操作 | ||
| プログラム開始からのプロセッサクロックの生時間を返す (関数) | ||
| システムのエポックからの現在の時刻を返す (関数) | ||
| 時刻間の差を計算する (関数) | ||
| (C++17) |
与えられた時間基準に基づいて、カレンダー時間を秒とナノ秒で返す (関数) | |
書式変換 | ||
| std::time_t オブジェクトをテキスト表現に変換する (関数) | ||
| std::tm オブジェクトをテキスト表現に変換する (関数) | ||
| std::tm オブジェクトをカスタムのテキスト表現に変換する (関数) | ||
| エポックからの時刻を世界協定時刻として表現されたカレンダー時刻に変換する (関数) | ||
| エポックからの時間を、地方時で表されるカレンダー時間に変換する (関数) | ||
| カレンダー時間をエポックからの時間に変換する (関数) | ||
[編集] 概要
#define NULL /* see description */ #define CLOCKS_PER_SEC /* see description */ #define TIME_UTC /* see description */ namespace std { using size_t = /* see description */; using clock_t = /* see description */; using time_t = /* see description */; struct timespec; struct tm; clock_t clock(); double difftime(time_t time1, time_t time0); time_t mktime(tm* timeptr); time_t time(time_t* timer); int timespec_get(timespec* ts, int base); char* asctime(const tm* timeptr); char* ctime(const time_t* timer); tm* gmtime(const time_t* timer); tm* localtime(const time_t* timer); size_t strftime(char* s, size_t maxsize, const char* format, const tm* timeptr); }
[編集] クラス std::timespec
struct timespec { std::time_t tv_sec; long tv_nsec; };
[編集] クラス std::tm
struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; };