名前空間
変種
操作

std::gmtime

提供: 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>
std::tm* gmtime( const time_t* time );
世界協定時刻(UTC)で表され、カレンダー時間にstd::time_t値としてエポックからの経過時間を与えられたに変換.
Original:
Converts given time since epoch as std::time_t value into calendar time, expressed in Coordinated Universal Time (UTC).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

time -
変換するtime_t型のオブジェクトへのポインタ
Original:
pointer to a time_t object to convert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

成功したのか、そうでなければstd::tm上の静的内部NULLオブジェクトへのポインタ。構造はstd::gmtime、とstd::localtimestd::ctime間で共有することができ、各呼び出しで上書きされるかもしれません.
Original:
Pointer to a static internal std::tm object on success, or NULL otherwise. The structure may shared between std::gmtime, std::localtime, and std::ctime and may be overwritten on each invocation.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] ノート

この関数は、スレッドセーフではないかもしれません.
Original:
This function may not be thread-safe.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
POSIXは引数が大きすぎるため、それが失敗した場合、この関数はerrnoEOVERFLOW設定している必要があります.
Original:
POSIX requires that this function sets errno to EOVERFLOW if it fails because the argument is too large.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

#include <iostream>
#include <iomanip>
#include <ctime>
 
int main()
{
    std::time_t t = std::time(NULL);
    std::cout << "UTC:   " << std::put_time(std::gmtime(&t), "%c %Z") << '\n'
              << "local: " << std::put_time(std::localtime(&t), "%c %Z") << '\n';
}

Output:

UTC:   Wed Dec 28 11:44:28 2011 GMT
local: Wed Dec 28 06:44:28 2011 EST

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

現地時刻で表したカレンダー時刻をエポックからの経過時間に変換します
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]
C documentation for gmtime