OSDN Git Service

Convert release and draft pages to UTF-8.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / ctime.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Sat Jul 24 19:49:27 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified Fri Apr 26 12:38:55 MET DST 1996 by Martin Schulze (joey@linux.de)
29 .\" Modified 2001-11-13, aeb
30 .\" Modified 2004-11-16, mtk
31 .\"
32 .\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya
33 .\"         all rights reserved.
34 .\" Translated 1997-02-10, Hiroaki Nagoya <nagoya@is.titech.ac.jp>
35 .\" Updated 1999-09-01, Kentaro Shirakata <argrath@ub32.org>
36 .\" Updated 2001-10-15, Kentaro Shirakata <argrath@ub32.org>
37 .\" Updated 2001-12-13, Kentaro Shirakata <argrath@ub32.org>
38 .\" Updated 2002-01-03, Kentaro Shirakata <argrath@ub32.org>
39 .\" Updated 2005-02-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
40 .\" Updated 2008-04-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.79
41 .\" Updated 2008-08-08, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.05
42 .\" Updated 2008-11-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.13
43 .\"
44 .\"WORD: Coordinated Univarsal Time  協定世界時
45 .\"WORD: broken-down time  要素別の時刻
46 .\"
47 .TH CTIME 3 2010-02-25 "" "Linux Programmer's Manual"
48 .\"O .SH NAME
49 .SH 名前
50 .\"O asctime, ctime, gmtime, localtime, mktime, asctime_r, ctime_r, gmtime_r,
51 .\"O localtime_r \- transform date and time to broken-down time or ASCII
52 asctime, ctime, gmtime, localtime, mktime, asctime_r, ctime_r, gmtime_r,
53 localtime_r \- 日付と時刻を要素別の時刻や ASCII に変換する
54 .\"O .SH SYNOPSIS
55 .SH 書式
56 .nf
57 .B #include <time.h>
58 .sp
59 .BI "char *asctime(const struct tm *" tm );
60 .br
61 .BI "char *asctime_r(const struct tm *" tm ", char *" buf );
62 .sp
63 .BI "char *ctime(const time_t *" timep );
64 .br
65 .BI "char *ctime_r(const time_t *" timep ", char *" buf );
66 .sp
67 .BI "struct tm *gmtime(const time_t *" timep );
68 .br
69 .BI "struct tm *gmtime_r(const time_t *" timep ", struct tm *" result );
70 .sp
71 .BI "struct tm *localtime(const time_t *" timep );
72 .br
73 .BI "struct tm *localtime_r(const time_t *" timep ", struct tm *" result );
74 .sp
75 .BI "time_t mktime(struct tm *" tm );
76 .fi
77 .sp
78 .in -4n
79 .\"O Feature Test Macro Requirements for glibc (see
80 .\"O .BR feature_test_macros (7)):
81 glibc 向けの機能検査マクロの要件
82 .RB ( feature_test_macros (7)
83 参照):
84 .in
85 .ad l
86 .sp
87 .BR asctime_r (),
88 .BR ctime_r (),
89 .BR gmtime_r (),
90 .BR localtime_r ():
91 .RS
92 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE ||
93 _SVID_SOURCE || _POSIX_SOURCE
94 .RE
95 .ad
96 .\"O .SH DESCRIPTION
97 .SH 説明
98 .\"O The
99 .\"O .BR ctime (),
100 .\"O .BR gmtime ()
101 .\"O and
102 .\"O .BR localtime ()
103 .\"O functions all take
104 .\"O an argument of data type \fItime_t\fP which represents calendar time.
105 .\"O When interpreted as an absolute time value, it represents the number of
106 .\"O seconds elapsed since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
107 関数
108 .BR ctime (),
109 .BR gmtime (),
110 .BR localtime ()
111
112 \fItime_t\fP 型のカレンダー時刻を引き数にとる。
113 引き数が絶対値として解釈される場合は、時刻紀元 (Epoch;
114 1970-01-01 00:00:00 +0000 (UTC)) からの経過秒数と解釈される。
115 .PP
116 .\"O The
117 .\"O .BR asctime ()
118 .\"O and
119 .\"O .BR mktime ()
120 .\"O functions both take an argument
121 .\"O representing broken-down time which is a representation
122 .\"O separated into year, month, day, etc.
123 関数
124 .BR asctime ()
125
126 .BR mktime ()
127
128 年・月・日などに分離された要素別の時刻を引き数とする。
129 .PP
130 .\"O Broken-down time is stored
131 .\"O in the structure \fItm\fP which is defined in \fI<time.h>\fP as follows:
132 要素別の時刻は \fI<time.h>\fP で以下のように定義されている
133 \fItm\fP 構造体に保持される。
134 .sp
135 .in +4n
136 .nf
137 struct tm {
138 .\"O     int tm_sec;         /* seconds */
139 .\"O     int tm_min;         /* minutes */
140 .\"O     int tm_hour;        /* hours */
141 .\"O     int tm_mday;        /* day of the month */
142 .\"O     int tm_mon;         /* month */
143 .\"O     int tm_year;        /* year */
144 .\"O     int tm_wday;        /* day of the week */
145 .\"O     int tm_yday;        /* day in the year */
146 .\"O     int tm_isdst;       /* daylight saving time */
147     int tm_sec;         /* 秒 */
148     int tm_min;         /* 分 */
149     int tm_hour;        /* 時間 */
150     int tm_mday;        /* 日 */
151     int tm_mon;         /* 月 */
152     int tm_year;        /* 年 */
153     int tm_wday;        /* 曜日 */
154     int tm_yday;        /* 年内通算日 */
155     int tm_isdst;       /* 夏時間 */
156 };
157 .fi
158 .in
159 .PP
160 .\"O The members of the \fItm\fP structure are:
161 \fItm\fP 構造体のメンバーは以下の通り:
162 .TP 10
163 .I tm_sec
164 .\"O The number of seconds after the minute, normally in the range 0 to 59,
165 .\"O but can be up to 60 to allow for leap seconds.
166 秒数、ふつうは 0 から 59 までの値、
167 しかし閏秒のため 60 までの値は許される。
168 .TP
169 .I tm_min
170 .\"O The number of minutes after the hour, in the range 0 to 59.
171 分数、0 から 59 までの値。
172 .TP
173 .I tm_hour
174 .\"O The number of hours past midnight, in the range 0 to 23.
175 真夜中からの通算時間、0 から 23 までの値。
176 .TP
177 .I tm_mday
178 .\"O The day of the month, in the range 1 to 31.
179 月はじめからの日数、1 から 31 までの値。
180 .TP
181 .I tm_mon
182 .\"O The number of months since January, in the range 0 to 11.
183 1月からの通算月数、0 から 11 までの値。
184 .TP
185 .I tm_year
186 .\"O The number of years since 1900.
187 1900 年からの通算年数。
188 .TP
189 .I tm_wday
190 .\"O The number of days since Sunday, in the range 0 to 6.
191 日曜日からの通算日数(曜日)。0 から 6 までの値。
192 .TP
193 .I tm_yday
194 .\"O The number of days since January 1, in the range 0 to 365.
195 1 月 1 日からの通算日数、0 から 365 までの値。
196 .TP
197 .I tm_isdst
198 .\"O A flag that indicates whether daylight saving time is in effect at the
199 .\"O time described.
200 .\"O The value is positive if daylight saving time is in
201 .\"O effect, zero if it is not, and negative if the information is not
202 .\"O available.
203 夏時間が有効かどうかのフラグ。
204 正の値ならば夏時間は有効になり、0 ならば無効、負の値ならばこの情報には
205 意味がない。
206 .PP
207 .\"O The call
208 .\"O .BI ctime( t )
209 .\"O is equivalent to
210 .\"O .BI asctime(localtime( t )) \fR.
211 .\"O It converts the calendar time \fIt\fP into a
212 .\"O null-terminated string of the form
213 .\"O .sp
214 .\"O .RS
215 .\"O "Wed Jun 30 21:49:08 1993\\n"
216 .\"O .RE
217 .\"O .sp
218 .BI ctime( t )
219 関数は、
220 .BI asctime(localtime( t ))
221 と等価である。
222 カレンダー時刻 \fIt\fP を
223 .sp
224 .RS
225 "Wed Jun 30 21:49:08 1993\\n"
226 .RE
227 .sp
228 という形式の NULL 終端された文字列へ変換する。
229 .\"O The abbreviations for the days of the week are "Sun", "Mon", "Tue", "Wed",
230 .\"O "Thu", "Fri", and "Sat".
231 .\"O The abbreviations for the months are "Jan",
232 .\"O "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", and
233 .\"O "Dec".
234 .\"O The return value points to a statically allocated string which
235 .\"O might be overwritten by subsequent calls to any of the date and time
236 .\"O functions.
237 .\"O The function also sets the external
238 .\"O variables \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP (see
239 .\"O .BR tzset (3))
240 .\"O with information about the current timezone.
241 曜日の略称は
242 "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" である。
243 月の略称は "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
244 "Sep", "Oct", "Nov", "Dec" である。
245 返り値は、静的 (static) に割り当てられた文字列へのポインタである。
246 この文字列は、日付・時刻関数のいずれかが呼び出されると上書きされることがある。
247 またこの関数は大域変数 \fItzname\fP, \fItimezone\fP, \fIdaylight\fP
248 に現在のタイムゾーンの情報を設定する
249 .RB ( tzset (3)
250 参照)。
251 .\"O The reentrant version
252 .\"O .BR ctime_r ()
253 .\"O does the same, but stores the
254 .\"O string in a user-supplied buffer
255 .\"O which should have room for at least 26 bytes.
256 .\"O It need not
257 .\"O set \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP.
258 リエントラント版である
259 .BR ctime_r ()
260 も同様だが、
261 文字列はユーザーが用意したバッファに格納される。バッファのサイズは
262 少なくとも 26 バイト以上でなければならない。
263 この関数は \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP
264 を設定する必要はない。
265 .PP
266 .\"O The
267 .\"O .BR gmtime ()
268 .\"O function converts the calendar time \fItimep\fP to
269 .\"O broken-down time representation, expressed in Coordinated Universal Time
270 .\"O (UTC).
271 .\"O It may return NULL when the year does not fit into an integer.
272 関数
273 .BR gmtime ()
274 は、カレンダー時刻 \fItimep\fP を
275 協定世界時 (UTC) での要素別の時刻へ変換する。
276 年が整数型に収まらない場合、NULL を返す。
277 .\"O The return value points to a statically allocated struct which might be
278 .\"O overwritten by subsequent calls to any of the date and time functions.
279 返り値は静的に確保された構造体を指しており、この後で
280 日付や時刻に関する関数のいずれかが呼び出されると
281 上書きされる可能性がある。
282 .\"O The
283 .\"O .BR gmtime_r ()
284 .\"O function does the same, but stores the data in a
285 .\"O user-supplied struct.
286 .BR gmtime_r ()
287 も同様だが、
288 データはユーザーが用意した構造体に格納される。
289 .PP
290 .\"O The
291 .\"O .BR localtime ()
292 .\"O function converts the calendar time \fItimep\fP to
293 .\"O broken-down time representation,
294 .\"O expressed relative to the user's specified timezone.
295 .\"O The function acts as if it called
296 .\"O .BR tzset (3)
297 .\"O and sets the external variables \fItzname\fP with
298 .\"O information about the current timezone, \fItimezone\fP with the difference
299 .\"O between Coordinated Universal Time (UTC) and local standard time in
300 .\"O seconds, and \fIdaylight\fP to a nonzero value if daylight savings
301 .\"O time rules apply during some part of the year.
302 関数
303 .BR localtime ()
304 は、カレンダー時刻 \fItimep\fP を
305 ユーザが指定したタイムゾーンでの時刻要素別の表現へ変換する。
306 この関数は
307 .BR tzset (3)
308 を呼び出したかのように振舞い、
309 大域変数 \fItzname\fP に現在のタイムゾーンの情報を設定する。
310 また、\fItimezone\fP に協定世界時 (UTC) とローカル標準時との
311 時差の秒数を設定し、
312 一年の一部で夏時間が適用される場合は \fIdaylight\fP に 0 が設定される。
313 .\"O The return value points to a statically allocated struct which might be
314 .\"O overwritten by subsequent calls to any of the date and time functions.
315 返り値は静的に確保された構造体を指しており、この後で
316 日付や時刻に関する関数のいずれかが呼び出されると
317 上書きされる可能性がある。
318 .\"O The
319 .\"O .BR localtime_r ()
320 .\"O function does the same, but stores the data in a
321 .\"O user-supplied struct.
322 .\"O It need not set \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP.
323 .BR localtime_r ()
324 も同様だが、
325 データはユーザーが用意した構造体に格納される。
326 この関数は \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP
327 を設定する必要はない。
328 .PP
329 .\"O The
330 .\"O .BR asctime ()
331 .\"O function converts the broken-down time value
332 .\"O \fItm\fP into a null-terminated string with the same format as
333 .\"O .BR ctime ().
334 .\"O The return value points to a statically allocated string which might be
335 .\"O overwritten by subsequent calls to any of the date and time functions.
336 関数
337 .BR asctime ()
338 は、要素別の時刻 \fItm\fP を
339 .BR ctime ()
340 と同じ形式の NULL 終端された文字列へ変換する。
341 返り値は静的に割り当てられた文字列へのポインタである。この文字列は、
342 日付・時刻関数のいずれかが呼び出されると上書きされることがある。
343 .\"O The
344 .\"O .BR asctime_r ()
345 .\"O function does the same, but stores the string in
346 .\"O a user-supplied buffer which should have room for at least 26 bytes.
347 リエントラント版である
348 .BR asctime_r ()
349 も同様だが、
350 文字列はユーザーが用意したバッファに格納される。バッファのサイズは
351 少なくとも 26 バイト以上でなければならない。
352 .PP
353 .\"O The
354 .\"O .BR mktime ()
355 .\"O function converts a broken-down time structure, expressed
356 .\"O as local time, to calendar time representation.
357 .\"O The function ignores
358 .\"O the values supplied by the caller in the
359 .\"O .I tm_wday
360 .\"O and
361 .\"O .I tm_yday
362 .\"O fields.
363 .\"O The value specified in the
364 .\"O .I tm_isdst
365 .\"O field informs
366 .\"O .BR mktime ()
367 .\"O whether or not daylight saving time (DST)
368 .\"O is in effect for the time supplied in the
369 .\"O .I tm
370 .\"O structure:
371 .\"O a positive value means DST is in effect;
372 .\"O zero means that DST is not in effect;
373 .\"O and a negative value means that
374 .\"O .BR mktime ()
375 .\"O should (use timezone information and system databases to)
376 .\"O attempt to determine whether DST is in effect at the specified time.
377 関数
378 .BR mktime ()
379 は、(ローカルタイムで記述されている) 要素別の時刻を
380 カレンダー時刻へ変換する。この際、呼び出し元がフィールド
381 .I tm_wday
382
383 .I tm_yday
384 で指定した値は無視される。
385 .BR mktime ()
386 は、フィールド
387 .I tm_isdst
388 で指定された値により、
389 .I tm
390 構造体で渡された時刻で夏時間 (daylight saving time; DST) が有効になって
391 いるかを知る。
392 正の値は夏時間が有効であることを意味する。
393 負の値であれば、
394 .BR mktime ()
395 は (タイムゾーン情報とシステムのデータベースを使って)
396 指定された時刻で夏時間が有効かどうかを判断する必要があることを意味する。
397
398 .\"O The
399 .\"O .BR mktime ()
400 .\"O function modifies the fields of the
401 .\"O .IR tm
402 .\"O structure as follows:
403 .\"O .I tm_wday
404 .\"O and
405 .\"O .I tm_yday
406 .\"O are set to values determined from the contents of the other fields;
407 .BR mktime ()
408
409 .I tm
410 構造体の各フィールドを以下のように修正する。
411 .I tm_wday
412
413 .I tm_yday
414 には他のフィールドの内容から求めた値を設定する。
415 .\"O if structure members are outside their valid interval, they will be
416 .\"O normalized (so that, for example, 40 October is changed into 9 November);
417 .\"O .I tm_isdst
418 .\"O is set (regardless of its initial value)
419 .\"O to a positive value or to 0, respectively,
420 .\"O to indicate whether DST is or is not in effect at the specified time.
421 構造体の要素が有効な範囲にない場合、正規化される
422 (例えば、10 月 40 日は 11 月 9 日に変更される)。
423 .I tm_isdst
424 には (最初の値にかかわらず) 正の値か 0 が設定される。
425 正の値は指定された時間で夏時間が有効であることを示し、
426 0 は無効であることを示す。
427 .\"O Calling
428 .\"O .BR mktime ()
429 .\"O also sets the external variable \fItzname\fP with
430 .\"O information about the current timezone.
431 関数
432 .BR mktime ()
433 を呼び出すと、
434 大域変数 \fItzname\fP が現在のタイムゾーンに設定される。
435
436 .\"O If the specified broken-down
437 .\"O time cannot be represented as calendar time (seconds since the Epoch),
438 .\"O .BR mktime ()
439 .\"O returns
440 .\"O .I (time_t)\ \-1
441 .\"O and does not alter the
442 .\"O members of the broken-down time structure.
443 要素別の時刻をカレンダー時刻 (紀元 (Epoch) からの秒数) で表現できない場合、
444 .BR mktime ()
445
446 .I (time_t)\ (-1)
447 を返し、要素別の時刻の構造体メンバーを変更しない。
448 .\"O .SH "RETURN VALUE"
449 .SH 返り値
450 .\"O Each of these functions returns the value described, or NULL
451 .\"O (\-1 in case of
452 .\"O .BR mktime ())
453 .\"O in case an error was detected.
454 各関数はそれぞれ前述した値を返す。エラーの場合は NULL
455 .RB ( mktime ()
456 では \-1) を返す。
457 .SH 準拠
458 .\"O POSIX.1-2001.
459 .\"O C89 and C99 specify
460 .\"O .BR asctime (),
461 .\"O .BR ctime (),
462 .\"O .BR gmtime (),
463 .\"O .BR localtime (),
464 .\"O and
465 .\"O .BR mktime ().
466 POSIX.1-2001.
467 C89 と C99 では
468 .BR asctime (),
469 .BR ctime (),
470 .BR gmtime (),
471 .BR localtime (),
472 .BR mktime ()
473 が規定されている。
474 .\"O POSIX.1-2008 marks
475 .\"O .BR asctime (),
476 .\"O .BR asctime_r (),
477 .\"O .BR ctime (),
478 .\"O and
479 .\"O .BR ctime_r ()
480 .\"O as obsolete,
481 .\"O recommending the use of
482 .\"O .BR strftime (3)
483 .\"O instead.
484 POSIX.1-2008 は、
485 .BR asctime (),
486 .BR asctime_r (),
487 .BR ctime (),
488 .BR ctime_r ()
489 を廃止予定としている。
490 代わりに、
491 .BR strftime (3)
492 の使用が推奨されている。
493 .\"O .SH NOTES
494 .SH 注意
495 .\"O The four functions
496 .\"O .BR asctime (),
497 .\"O .BR ctime (),
498 .\"O .BR gmtime ()
499 .\"O and
500 .\"O .BR localtime ()
501 .\"O return a pointer to static data and hence are not thread-safe.
502 .BR asctime (),
503 .BR ctime (),
504 .BR gmtime (),
505 .BR localtime ()
506 の 4 つの関数は静的データへのポインタを返すので、スレッドセーフではない。
507 .\"O Thread-safe versions
508 .\"O .BR asctime_r (),
509 .\"O .BR ctime_r (),
510 .\"O .BR gmtime_r ()
511 .\"O and
512 .\"O .BR localtime_r ()
513 .\"O are specified by SUSv2, and available since libc 5.2.5.
514 これらの関数のスレッドセーフ版である
515 .BR asctime_r (),
516 .BR ctime_r (),
517 .BR gmtime_r (),
518 .BR localtime_r ()
519 は SUSv2 で規定されており、
520 libc 5.2.5 以降で利用できる。
521
522 .\"O POSIX.1-2001 says:
523 .\"O "The
524 .\"O .BR asctime (),
525 .\"O .BR ctime (),
526 .\"O .BR gmtime (),
527 .\"O and
528 .\"O .BR localtime ()
529 .\"O functions shall return values in one of two static objects:
530 .\"O a broken-down time structure and an array of type
531 .\"O .IR char .
532 .\"O Execution of any of the functions may overwrite the information returned
533 .\"O in either of these objects by any of the other functions."
534 .\"O This can occur in the glibc implementation.
535 POSIX.1-2001 では、「関数
536 .BR asctime (),
537 .BR ctime (),
538 .BR gmtime (),
539 .BR localtime ()
540 は、要素別の時刻の構造体か
541 .I char
542 型の配列かのどちらかの静的オブジェクトを返すものとする。
543 これらの関数のいずれかを実行すると、他の関数のどれかがこれらの
544 静的オブジェクトのどちらかに格納して返した情報が上書きされるかも
545 しれない。」となっている。
546 このことは glibc の実装で起こりうる。
547 .LP
548 .\"O In many implementations, including glibc, a 0 in
549 .\"O .I tm_mday
550 .\"O is interpreted as meaning the last day of the preceding month.
551 glibc を含む多くの実装では、
552 .I tm_mday
553 に 0 を指定すると前月の最終日を意味していると解釈される。
554 .LP
555 .\"O The glibc version of \fIstruct tm\fP has additional fields
556 .\"O .sp
557 .\"O .RS
558 .\"O .nf
559 .\"O long tm_gmtoff;           /* Seconds east of UTC */
560 .\"O const char *tm_zone;      /* Timezone abbreviation */
561 .\"O .fi
562 .\"O .RE
563 .\"O .sp
564 .\"O defined when
565 .\"O .B _BSD_SOURCE
566 .\"O was set before including
567 .\"O .IR <time.h> .
568 glibc では、
569 .I <time.h>
570 がインクルードされる前に
571 .B _BSD_SOURCE
572 が定義されると、
573 \fIstruct tm\fP に以下のフィールドが追加される。
574 .sp
575 .RS
576 .nf
577 long tm_gmtoff;           /* Seconds east of UTC */
578 const char *tm_zone;      /* Timezone abbreviation */
579 .fi
580 .RE
581 .sp
582 .\"O This is a BSD extension, present in 4.3BSD-Reno.
583 これは BSD 拡張であり、4.3BSD-Reno から現れた。
584
585 .\"O According to POSIX.1-2004,
586 .\"O .BR localtime ()
587 .\"O is required to behave as though
588 .\"O .BR tzset (3)
589 .\"O was called, while
590 .\"O .BR localtime_r ()
591 .\"O does not have this requirement.
592 .\"O .\" See http://thread.gmane.org/gmane.comp.time.tz/2034/
593 .\"O For portable code
594 .\"O .BR tzset (3)
595 .\"O should be called before
596 .\"O .BR localtime_r ().
597 POSIX.1-2004 によると、
598 .BR localtime ()
599 はあたかも
600 .BR tzset (3)
601 が呼ばれたかのように振舞うことが要求されているが、
602 .BR localtime_r ()
603 にはこの要件はない。
604 .\" http://thread.gmane.org/gmane.comp.time.tz/2034/ を参照。
605 移植性が必要なコードでは、
606 .BR localtime_r ()
607 の前に
608 .BR tzset (3)
609 を呼び出しておくべきである。
610 .\"O .SH "SEE ALSO"
611 .SH 関連項目
612 .BR date (1),
613 .BR gettimeofday (2),
614 .BR time (2),
615 .BR utime (2),
616 .BR clock (3),
617 .BR difftime (3),
618 .BR strftime (3),
619 .BR strptime (3),
620 .BR timegm (3),
621 .BR tzset (3),
622 .BR time (7)