.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 .\" .\" %%%LICENSE_START(VERBATIM) .\" 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. .\" %%%LICENSE_END .\" .\" Modified by Michael Haardt .\" Modified Sat Jul 24 14:13:40 1993 by Rik Faith .\" Additions by Joseph S. Myers , 970909 .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" 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 .\" .TH TIME 2 2011\-09\-09 Linux "Linux Programmer's Manual" .SH 名前 time \- 秒単位の時間を得る .SH 書式 \fB#include \fP .sp \fBtime_t time(time_t *\fP\fIt\fP\fB);\fP .SH 説明 \fBtime\fP() は、紀元 (Epoch; 1970\-01\-01 00:00:00 (UTC)) からの秒数で返す。 もし \fIt\fP が NULL でなかったら返り値は \fIt\fP の指しているメモリーにも格納される。 .SH 返り値 成功した場合、紀元(the Epoch)からの経過秒数を返す。エラーの場合は \fI((time_t)\ \-1)\fP を返し、\fIerrno\fP を設定する。 .SH エラー .TP \fBEFAULT\fP \fIt\fP がアクセス可能なアドレス空間の外を指している。 .SH 準拠 .\" .br .\" Under 4.3BSD, this call is obsoleted by .\" .BR gettimeofday (2). SVr4, 4.3BSD, C89, C99, POSIX.1\-2001. POSIX にはエラー状態の規定はない。 .SH 注意 POSIX.1 では、指定した時刻と紀元との間の秒数を近似する変換式を使って、 \fI「紀元からの経過秒数 (seconds since the Epoch)」\fP を定義している。 この変換式では、4 で割り切れる年で、100 で割り切れない年はすべて閏年 (但し、400 で割り切れる年は閏年) であるという点も考慮されている。 「紀元からの経過秒数」は、紀元と現在時刻との間で実際に経過した秒数と同じではない。 なぜならば、閏秒が存在するし、システムの時計を標準時間 (standard reference) に同期させる必要もないからである。 この定義の目的は、紀元からの経過秒数の解釈に一貫性を持たせることになる。 より詳しい原理は POSIX.1 Rationale A.4.15 を参照すること。 .SH 関連項目 \fBdate\fP(1), \fBgettimeofday\fP(2), \fBctime\fP(3), \fBftime\fP(3), \fBtime\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。