.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright (c) 1993 Michael Haardt .\" (u31b3hs@pool.informatik.rwth-aachen.de) .\" Fri Apr 2 11:32:09 MET DST 1993 .\" .\" 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, write to the Free .\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, .\" USA. .\" .\" 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 .\" .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka .\" all rights reserved. .\" Translated Thu Dec 25 10:53:32 JST 1997 .\" by HIROFUMI Nishizuka .\" .\" Updated Tue Jul 8 JST 1999 by Kentaro Shirakata .\" Updated Fri Dec 21 JST 2001 by Kentaro Shirakata .\" Updated Wed Jul 30 JST 2008 by Kentaro Shirakata .\" .TH FTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual" .SH 名前 ftime \- 日付と時間を返す .SH 書式 .B "#include " .sp .BI "int ftime(struct timeb *" tp ); .SH 説明 この関数は現在の時刻を、紀元 (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) からの秒数とミリ秒数で返す。 時刻は .I tp で返され、これは以下のように定義されている: .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 の内容は未定義である; これに頼るのは避けること。 \"O .SH "RETURN VALUE" .SH 返り値 \"O This function always returns 0. この関数は常に 0 を返す。 (POSIX.1-2001 仕様及びいくつかのシステムのドキュメントでは、 エラー時に \-1 を返す。) \"O .SH "CONFORMING TO" .SH 準拠 4.2BSD, POSIX.1-2001. POSIX.1-2008 では .BR ftime () の仕様が削除されている。 この関数は古いものである。使ってはならない。 秒単位の時間で十分なら、 .BR time (2) が利用できる。 .BR gettimeofday (2) でマイクロ秒が得られる。 .BR clock_gettime (2) でナノ秒が得られるが、広く利用可能な訳ではない。 \"O .SH BUGS .SH バグ .LP \"O glibc 2.1.1 is correct again. \fImillitm\fP フィールドは、libc4 と libc5 では正しく動作する。 しかし、初期の glibc2 ではバグがあり、常に 0 を返す。 glibc 2.1.1 から再び正常になった。 \"O .\" .SH HISTORY \"O .\" The \"O .\" .B ftime() \"O .\" function appeared in 4.2BSD. .\" .SH 歴史 .\" .BR ftime () .\" 関数は 4.2BSD に現れた。 \"O .SH "SEE ALSO" .SH 関連項目 .BR gettimeofday (2), .BR time (2)