名前空間
変種
操作

std::time

提供: cppreference.com
< cpp‎ | chrono‎ | c

 
 
ユーティリティライブラリ
支援を入力します (basic types, RTTI, type traits)
動的なメモリ管理
エラー処理
プログラムユーティリティ
可変個引数関数
日付と時刻
関数オブジェクト
initializer_list(C++11)
bitset
hash(C++11)
関係演算子
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
ペアとタプル
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
フォワード、スワップ、および移動
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
 
C形式の日付と時刻のユーティリティ
機能します
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
時間操作
Original:
Time manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
difftime
time
clock
フォーマット変換
Original:
Format conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
asctime
ctime
strftime
wcsftime
gmtime
localtime
mktime
定数
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
CLOCKS_PER_SEC
タイプ
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
tm
time_t
clock_t
 
Defined in header <ctime>
time_t time( std::time_t *time );
std::time_tオブジェクトとしてエンコードされ、現在のカレンダー時刻を返します。.
Original:
Returns the current calendar time encoded as a std::time_t object.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

time -
またはstd::time_tで時間を格納するNULLオブジェクトへのポインタ
Original:
pointer to a std::time_t object to store the time in or NULL
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

現在のカレンダー時間は、エラーの場合std::time_t、成功した場合に(std::time_t)(-1)オブジェクトとしてエンコードされます。引数がNULLでない場合、戻り値もtime指すオブジェクトに設定されています.
Original:
Current calendar time encoded as std::time_t object on success, (std::time_t)(-1) on error. If the argument is not NULL, the return value is also set to the object pointed by time.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] ノート

std::time_tでカレンダ時刻のエンコーディングが指定されていませんが、ほとんどのシステムはPOSIX specificationに準拠しており、エポックからの経過秒数を保持する整数型の値を返す。 std::time_tは、32ビットの符号付き整数(多くの歴史的なインプリメンテーション)である実装は、2038年に失敗.
Original:
The encoding of calendar time in std::time_t is unspecified, but most systems conform to POSIX specification and return a value of integral type holding the number of seconds since the Epoch. Implementations in which std::time_t is a 32-bit signed integer (many historical implementations) fail in the year 2038.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

#include <ctime>
#include <iostream>
 
int main()
{
    std::time_t result = std::time(NULL);
    std::cout << std::asctime(std::localtime(&result))
              << result << " seconds since the Epoch\n";
}

Output:

Wed Sep 21 10:27:52 2011
1316615272 seconds since the Epoch

[編集] も参照してください

現地時刻で表したカレンダー時刻をエポックからの経過時間に変換します
Original:
converts time since epoch to calendar time expressed as local time
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(機能) [edit]
世界標準時として表現カレンダー時刻にエポックからの経過時間に変換します
Original:
converts time since epoch to calendar time expressed as Universal Coordinated Time
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(機能) [edit]
システム全体のリアルタイムクロックから壁時計時刻
Original:
wall clock time from the system-wide realtime clock
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(クラス) [edit]