.\" Copyright (c) 1993 Michael Haardt .\" (michael@moria.de) .\" Fri Apr 2 11:32:09 MET DST 1993 .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL) .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, see .\" . .\" %%%LICENSE_END .\" .\" Modified Sat Jul 24 14:23:14 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Sun Oct 18 17:31:43 1998 by Andries Brouwer (aeb@cwi.nl) .\" 2008-06-23, mtk, minor rewrites, added some details .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka .\" all rights reserved. .\" Translated Thu Dec 25 10:53:32 JST 1997 .\" by HIROFUMI Nishizuka .\" .TH FTIME 3 2014\-08\-19 GNU "Linux Programmer's Manual" .SH 名前 ftime \- 日付と時間を返す .SH 書式 \fB#include \fP .sp \fBint ftime(struct timeb *\fP\fItp\fP\fB);\fP .SH 説明 この関数は現在の時刻を、紀元 (Epoch; 1970\-01\-01 00:00:00 +0000 (UTC)) からの秒数とミリ秒数で返す。 時刻は \fItp\fP で返され、これは以下のように定義されている: .sp .in +4n .nf struct timeb { time_t time; unsigned short millitm; short timezone; short dstflag; }; .fi .in .LP ここで、\fItime\fP は紀元 (the Epoch) からの秒数、 \fImillitm\fP は 紀元から \fItime\fP 秒後からのミリ秒数である。 \fItimezone\fP フィールドはグリニッジから西周りの分で計測される ローカルタイムゾーンである(負数の場合はグリニッジからの東回りの分を 示す)。 \fIdstflag\fP フィールドは、もし 0 でなければ一年の一部で夏時間が 存在することを示すフラグである。 .LP POSIX.1\-2001 では、\fItimezone\fP と \fIdstflag\fP の内容は未定義である; これに頼るのは避けること。 .SH 返り値 この関数は常に 0 を返す。 (POSIX.1\-2001 仕様及びいくつかのシステムのドキュメントでは、 エラー時に \-1 を返す。) .SH 属性 .SS "マルチスレッディング (pthreads(7) 参照)" \fBftime\fP() 関数はスレッドセーフである。 .SH 準拠 4.2BSD, POSIX.1\-2001. POSIX.1\-2008 では \fBftime\fP() の仕様が削除されている。 この関数は古いものである。使ってはならない。 秒単位の時間で十分なら、 \fBtime\fP(2) が利用できる。 \fBgettimeofday\fP(2) でマイクロ秒が得られる。 \fBclock_gettime\fP(2) でナノ秒が得られるが、広く利用可能な訳ではない。 .SH バグ .LP .\" .SH HISTORY .\" The .\" .BR ftime () .\" function appeared in 4.2BSD. 初期の glibc2 ではバグがあり、常に \fImillitm\fP フィールドに 0 を返す。 glibc 2.1.1 から再び正常になった。 .SH 関連項目 \fBgettimeofday\fP(2), \fBtime\fP(2) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。