.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Modified by Michael Haardt .\" Modified Sat Jul 24 14:13:40 1993 by Rik Faith .\" Additions by Joseph S. Myers , 970909 .\" .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki .\" all rights reserved. .\" Translated Thu Jun 26 21:11:17 JST 1997 .\" by SUTO, Mitsuaki .\" Modified Sun Mar 21 17:23:27 JST 1999 .\" by HANATAKA Shinya .\" .\"WORD: the Epoch 紀元 .\" .TH TIME 2 2010-02-25 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O time \- get time in seconds time \- 秒単位の時間を得る .\"O .SH SYNOPSIS .SH 書式 .B #include .sp .BI "time_t time(time_t *" t ); .\"O .SH DESCRIPTION .SH 説明 .\"O .BR time () .\"O returns the time as the number of seconds since the .\"O Epoch, 1970-01-01 00:00:00 +0000 (UTC). .BR time () は、紀元 (Epoch; 1970-01-01 00:00:00 (UTC)) からの秒数で返す。 .\"O If .\"O .I t .\"O is non-NULL, .\"O the return value is also stored in the memory pointed to by .\"O .IR t . もし .I t が NULL でなかったら返り値は .I t の指しているメモリにも格納される。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O On success, the value of time in seconds since the Epoch is returned. .\"O On error, \fI((time_t)\ \-1)\fP is returned, and \fIerrno\fP is set .\"O appropriately. 成功した場合、紀元(the Epoch)からの経過秒数を返す。エラーの場合は \fI((time_t)\ \-1)\fP を返し、\fIerrno\fP を設定する。 .\"O .SH ERRORS .SH エラー .TP .B EFAULT .\"O .I t .\"O points outside your accessible address space. .I t がアクセス可能なアドレス空間の外を指している。 .\"O .SH "CONFORMING TO" .SH 準拠 SVr4, 4.3BSD, C89, C99, POSIX.1-2001. .\" .br .\"O .\" Under 4.3BSD, this call is obsoleted by .\"O .\" .BR gettimeofday (2). .\"O POSIX does not specify any error conditions. .\" 4.3BSD ではこの関数は .\" .BR gettimeofday (2) .\" に取って代わられている。 POSIX にはエラー状態の規定はない。 .\"O .SH NOTES .SH 注意 .\"O POSIX.1 defines .\"O .I seconds since the Epoch .\"O as a value to be interpreted as the number of seconds between a .\"O specified time and the Epoch, according to a formula for conversion .\"O from UTC equivalent to conversion on the naive basis that leap .\"O seconds are ignored and all years divisible by 4 are leap years. .\"O This value is not the same as the actual number of seconds between the time .\"O and the Epoch, because of leap seconds and because clocks are not .\"O required to be synchronized to a standard reference. .\"O The intention is .\"O that the interpretation of seconds since the Epoch values be .\"O consistent; see POSIX.1 Annex B 2.2.2 for further rationale. POSIX.1 では .I 「紀元からの経過秒数 (seconds since the Epoch)」 は指定した時刻と紀元との間の秒数であると定義している。 ただしこのとき UTC (協定世界時) から秒を求める変換には、素朴な変換式 (閏秒を無視し、 4 で割り切れる年をすべて閏年とした式) を用いるものとしている。 この値は紀元と現在時刻との間で実際に経過した秒数と同じではない。 なぜならば閏秒が存在するし、時計(clock)を標準時間(standard reference)に 同期させることを要求されていないからである。 この定義の意図は紀元からの経過秒数の解釈を一定にすることである。 より詳しい原理は POSIX.1 Annex B 2.2.2 を参照すること。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR date (1), .BR gettimeofday (2), .BR ctime (3), .BR ftime (3), .BR time (7)