gmtime_r
Time.h:インデックス への移動
ヘッダー ファイル
time.h
カテゴリ
日付/時刻ルーチン
プロトタイプ
struct tm *gmtime_r( const time_t *timer, struct tm *buf );
説明
カレンダーの時間を UTC 時間に変換します。
gmtime_r は、tm や result に null は使用できません。
tm 構造体の詳細については、「gmtime」を参照してください。
戻り値
gmtime_r は、成功した場合には result を、そうでなければ null を返します。
例
#include <time.h> #include <stdio.h> #include <stdlib.h> // for putenv int main() { time_t t = time(NULL); struct tm tmbuf; char buf[30]; printf("UTC: %s", asctime_r(gmtime_r(&t, &tmbuf), buf)); printf("local: %s", asctime_r(localtime_r(&t, &tmbuf), buf)); }
移植性
POSIX | Win32 | ANSI C | ANSI C++ |
---|---|---|---|
+ |
+ |
+ |
+ |