TIMEGM

Section: Linux Programmer's Manual (3)
Updated: 2016-12-12
Index JM Home Page
 

名前

timegm, timelocal - gmtime と localtime の逆関数  

書式

#include <time.h>

time_t timelocal(struct tm *tm);

time_t timegm(struct tm *tm);

glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):

timelocal(), timegm():
    Since glibc 2.19:
        _DEFAULT_SOURCE
    Glibc 2.19 and earlier:
        _BSD_SOURCE || _SVID_SOURCE  

説明

The functions timelocal() and timegm() are the inverses of localtime(3) and gmtime(3). Both functions take a broken-down time and convert it to calendar time (seconds since the Epoch, 1970-01-01 00:00:00 +0000, UTC). The difference between the two functions is that timelocal() takes the local timezone into account when doing the conversion, while timegm() takes the input value to be Coordinated Universal Time (UTC).  

返り値

On success, these functions return the calendar time (seconds since the Epoch), expressed as a value of type time_t. On error, they return the value (time_t) -1 and set errno to indicate the cause of the error.  

エラー

EOVERFLOW
The result cannot be represented.
 

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース 属性

 timelocal(), timegm()
Thread safety MT-Safe env locale
 

準拠

これらの関数は非標準で GNU の拡張である。 BSD 系にも存在する。 これらの使用は避けること。  

注意

timelocal() 関数は POSIX の標準関数 mktime(3) と同じものである。 ので、これを使う理由はないはずである。  

関連項目

gmtime(3), localtime(3), mktime(3), tzset(3)  

この文書について

この man ページは Linux man-pages プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は https://www.kernel.org/doc/man-pages/ に書かれている。

関連キーワード

time, timelocal, TIMEGM, timegm, functions, localtime, 関数, SOURCE, pages, gmtime

Linux マニュアル 一覧

[man1] [man2] [man3] [man4] [man5] [man6] [man7] [man8]
[a] [b] [c] [d] [e] [f] [g] [h] [i] [j] [k] [l] [m] [n] [o] [p] [q] [r] [s] [t] [u] [v] [w] [x] [y] [z]

 

Index

名前
書式
説明
返り値
エラー
属性
準拠
注意
関連項目
この文書について

This document was created by man2html, using the manual pages.
Time: 12:08:36 GMT, June 11, 2022