標準ライブラリヘッダ <ctime> - cppreference.com
提供: cppreference.com
このヘッダは元々 C 標準ライブラリに <time.h> として存在していました。
このヘッダは C スタイルの日付と時間のライブラリの一部です。
マクロ定数
型
関数
時間操作 | |
| プログラムが開始されてから経過した生のプロセッサクロック時間を返します (関数) [edit] | |
| 現在のシステム時刻をエポックからの経過時間として返します (関数) [edit] | |
| 時刻の差を計算します (関数) [edit] | |
(C++17) |
指定されたタイムベースにおけるカレンダー時刻を返します (関数) [edit] |
フォーマット変換 | |
time_t オブジェクトをテキスト表現に変換します (関数) [edit] | |
tm オブジェクトをテキスト表現に変換します (関数) [edit] | |
tm オブジェクトをカスタムテキスト表現に変換します (関数) [edit] | |
tm オブジェクトをカスタムテキスト表現のワイド文字列に変換します (関数) [edit] | |
| エポックからの経過時間を協定世界時で表されるカレンダー時刻に変換します (関数) [edit] | |
| エポックからの経過時間を現地時間で表されるカレンダー時刻に変換します (関数) [edit] | |
| カレンダー時刻をエポックからの経過時間に変換します (関数) [edit] | |
概要
#define NULL /* see definition */ #define CLOCKS_PER_SEC /* see definition */ #define TIME_UTC /* see definition */ namespace std { using size_t = /* see definition */; using clock_t = /* see definition */; using time_t = /* see definition */; struct timespec; struct tm; clock_t clock(); double difftime(time_t time1, time_t time0); time_t mktime(struct tm* timeptr); time_t time(time_t* timer); int timespec_get(timespec* ts, int base); char* asctime(const struct tm* timeptr); char* ctime(const time_t* timer); struct tm* gmtime(const time_t* timer); struct tm* localtime(const time_t* timer); size_t strftime(char* s, size_t maxsize, const char* format, const struct 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; };