1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
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.
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.
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
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" References consulted:
24 .\" Linux libc source code
25 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
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
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
44 .\"WORD: Coordinated Univarsal Time ¶¨ÄêÀ¤³¦»þ
45 .\"WORD: broken-down time Í×ÁÇÊ̤λþ¹ï
47 .TH CTIME 3 2010-02-25 "" "Linux Programmer's Manual"
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 ¤ËÊÑ´¹¤¹¤ë
59 .BI "char *asctime(const struct tm *" tm );
61 .BI "char *asctime_r(const struct tm *" tm ", char *" buf );
63 .BI "char *ctime(const time_t *" timep );
65 .BI "char *ctime_r(const time_t *" timep ", char *" buf );
67 .BI "struct tm *gmtime(const time_t *" timep );
69 .BI "struct tm *gmtime_r(const time_t *" timep ", struct tm *" result );
71 .BI "struct tm *localtime(const time_t *" timep );
73 .BI "struct tm *localtime_r(const time_t *" timep ", struct tm *" result );
75 .BI "time_t mktime(struct tm *" tm );
79 .\"O Feature Test Macro Requirements for glibc (see
80 .\"O .BR feature_test_macros (7)):
81 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
82 .RB ( feature_test_macros (7)
92 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE ||
93 _SVID_SOURCE || _POSIX_SOURCE
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).
112 \fItime_t\fP ·¿¤Î¥«¥ì¥ó¥À¡¼»þ¹ï¤ò°ú¤¿ô¤Ë¤È¤ë¡£
113 °ú¤¿ô¤¬ÀäÂÐÃͤȤ·¤Æ²ò¼á¤µ¤ì¤ë¾ì¹ç¤Ï¡¢»þ¹ïµª¸µ (Epoch;
114 1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤Î·Ð²áÉÿô¤È²ò¼á¤µ¤ì¤ë¡£
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.
128 ǯ¡¦·î¡¦Æü¤Ê¤É¤ËʬΥ¤µ¤ì¤¿Í×ÁÇÊ̤λþ¹ï¤ò°ú¤¿ô¤È¤¹¤ë¡£
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 ¹½Â¤ÂΤËÊÝ»ý¤µ¤ì¤ë¡£
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 */
149 int tm_hour; /* »þ´Ö */
150 int tm_mday; /* Æü */
153 int tm_wday; /* ÍËÆü */
154 int tm_yday; /* ǯÆâÄÌ»»Æü */
155 int tm_isdst; /* ²Æ»þ´Ö */
160 .\"O The members of the \fItm\fP structure are:
161 \fItm\fP ¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Ï°Ê²¼¤ÎÄ̤ê:
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 ¤Þ¤Ç¤ÎÃͤϵö¤µ¤ì¤ë¡£
170 .\"O The number of minutes after the hour, in the range 0 to 59.
171 ʬ¿ô¡¢0 ¤«¤é 59 ¤Þ¤Ç¤ÎÃÍ¡£
174 .\"O The number of hours past midnight, in the range 0 to 23.
175 ¿¿ÌëÃ椫¤é¤ÎÄÌ»»»þ´Ö¡¢0 ¤«¤é 23 ¤Þ¤Ç¤ÎÃÍ¡£
178 .\"O The day of the month, in the range 1 to 31.
179 ·î¤Ï¤¸¤á¤«¤é¤ÎÆü¿ô¡¢1 ¤«¤é 31 ¤Þ¤Ç¤ÎÃÍ¡£
182 .\"O The number of months since January, in the range 0 to 11.
183 1·î¤«¤é¤ÎÄÌ»»·î¿ô¡¢0 ¤«¤é 11 ¤Þ¤Ç¤ÎÃÍ¡£
186 .\"O The number of years since 1900.
187 1900 ǯ¤«¤é¤ÎÄÌ»»Ç¯¿ô¡£
190 .\"O The number of days since Sunday, in the range 0 to 6.
191 ÆüÍËÆü¤«¤é¤ÎÄÌ»»Æü¿ô(ÍËÆü)¡£0 ¤«¤é 6 ¤Þ¤Ç¤ÎÃÍ¡£
194 .\"O The number of days since January 1, in the range 0 to 365.
195 1 ·î 1 Æü¤«¤é¤ÎÄÌ»»Æü¿ô¡¢0 ¤«¤é 365 ¤Þ¤Ç¤ÎÃÍ¡£
198 .\"O A flag that indicates whether daylight saving time is in effect at the
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
203 ²Æ»þ´Ö¤¬Í¸ú¤«¤É¤¦¤«¤Î¥Õ¥é¥°¡£
204 Àµ¤ÎÃͤʤé¤Ð²Æ»þ´Ö¤Ï͸ú¤Ë¤Ê¤ê¡¢0 ¤Ê¤é¤Ð̵¸ú¡¢Éé¤ÎÃͤʤé¤Ð¤³¤Î¾ðÊó¤Ë¤Ï
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
215 .\"O "Wed Jun 30 21:49:08 1993\\n"
220 .BI asctime(localtime( t ))
222 ¥«¥ì¥ó¥À¡¼»þ¹ï \fIt\fP ¤ò
225 "Wed Jun 30 21:49:08 1993\\n"
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
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
237 .\"O The function also sets the external
238 .\"O variables \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP (see
240 .\"O with information about the current timezone.
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 ¤Ë¸½ºß¤Î¥¿¥¤¥à¥¾¡¼¥ó¤Î¾ðÊó¤òÀßÄꤹ¤ë
251 .\"O The reentrant version
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.
257 .\"O set \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP.
258 ¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤ¢¤ë
261 ʸ»úÎó¤Ï¥æ¡¼¥¶¡¼¤¬ÍÑ°Õ¤·¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ë¡£¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ï
262 ¾¯¤Ê¤¯¤È¤â 26 ¥Ð¥¤¥È°Ê¾å¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
263 ¤³¤Î´Ø¿ô¤Ï \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP
264 ¤òÀßÄꤹ¤ëɬÍפϤʤ¤¡£
268 .\"O function converts the calendar time \fItimep\fP to
269 .\"O broken-down time representation, expressed in Coordinated Universal Time
271 .\"O It may return NULL when the year does not fit into an integer.
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 ¾å½ñ¤¤µ¤ì¤ë²ÄǽÀ¤¬¤¢¤ë¡£
284 .\"O function does the same, but stores the data in a
285 .\"O user-supplied struct.
288 ¥Ç¡¼¥¿¤Ï¥æ¡¼¥¶¡¼¤¬ÍÑ°Õ¤·¤¿¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤ë¡£
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
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.
304 ¤Ï¡¢¥«¥ì¥ó¥À¡¼»þ¹ï \fItimep\fP ¤ò
305 ¥æ¡¼¥¶¤¬»ØÄꤷ¤¿¥¿¥¤¥à¥¾¡¼¥ó¤Ç¤Î»þ¹ïÍ×ÁÇÊ̤Îɽ¸½¤ØÊÑ´¹¤¹¤ë¡£
308 ¤ò¸Æ¤Ó½Ð¤·¤¿¤«¤Î¤è¤¦¤Ë¿¶Éñ¤¤¡¢
309 Âç°èÊÑ¿ô \fItzname\fP ¤Ë¸½ºß¤Î¥¿¥¤¥à¥¾¡¼¥ó¤Î¾ðÊó¤òÀßÄꤹ¤ë¡£
310 ¤Þ¤¿¡¢\fItimezone\fP ¤Ë¶¨ÄêÀ¤³¦»þ (UTC) ¤È¥í¡¼¥«¥ëɸ½à»þ¤È¤Î
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 ¾å½ñ¤¤µ¤ì¤ë²ÄǽÀ¤¬¤¢¤ë¡£
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.
325 ¥Ç¡¼¥¿¤Ï¥æ¡¼¥¶¡¼¤¬ÍÑ°Õ¤·¤¿¹½Â¤ÂΤ˳ÊǼ¤µ¤ì¤ë¡£
326 ¤³¤Î´Ø¿ô¤Ï \fItzname\fP, \fItimezone\fP, and \fIdaylight\fP
327 ¤òÀßÄꤹ¤ëɬÍפϤʤ¤¡£
331 .\"O function converts the broken-down time value
332 .\"O \fItm\fP into a null-terminated string with the same format as
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.
338 ¤Ï¡¢Í×ÁÇÊ̤λþ¹ï \fItm\fP ¤ò
340 ¤ÈƱ¤¸·Á¼°¤Î NULL ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤ØÊÑ´¹¤¹¤ë¡£
341 ÊÖ¤êÃͤÏÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£¤³¤Îʸ»úÎó¤Ï¡¢
342 ÆüÉÕ¡¦»þ¹ï´Ø¿ô¤Î¤¤¤º¤ì¤«¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¤È¾å½ñ¤¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£
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 ¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤ¢¤ë
350 ʸ»úÎó¤Ï¥æ¡¼¥¶¡¼¤¬ÍÑ°Õ¤·¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ë¡£¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ï
351 ¾¯¤Ê¤¯¤È¤â 26 ¥Ð¥¤¥È°Ê¾å¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
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
363 .\"O The value specified in the
367 .\"O whether or not daylight saving time (DST)
368 .\"O is in effect for the time supplied in the
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
375 .\"O should (use timezone information and system databases to)
376 .\"O attempt to determine whether DST is in effect at the specified time.
379 ¤Ï¡¢(¥í¡¼¥«¥ë¥¿¥¤¥à¤Çµ½Ò¤µ¤ì¤Æ¤¤¤ë) Í×ÁÇÊ̤λþ¹ï¤ò
380 ¥«¥ì¥ó¥À¡¼»þ¹ï¤ØÊÑ´¹¤¹¤ë¡£¤³¤ÎºÝ¡¢¸Æ¤Ó½Ð¤·¸µ¤¬¥Õ¥£¡¼¥ë¥É
384 ¤Ç»ØÄꤷ¤¿ÃͤÏ̵»ë¤µ¤ì¤ë¡£
388 ¤Ç»ØÄꤵ¤ì¤¿Ãͤˤè¤ê¡¢
390 ¹½Â¤ÂΤÇÅϤµ¤ì¤¿»þ¹ï¤Ç²Æ»þ´Ö (daylight saving time; DST) ¤¬Í¸ú¤Ë¤Ê¤Ã¤Æ
392 Àµ¤ÎÃͤϲƻþ´Ö¤¬Í¸ú¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£
395 ¤Ï (¥¿¥¤¥à¥¾¡¼¥ó¾ðÊó¤È¥·¥¹¥Æ¥à¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»È¤Ã¤Æ)
396 »ØÄꤵ¤ì¤¿»þ¹ï¤Ç²Æ»þ´Ö¤¬Í¸ú¤«¤É¤¦¤«¤òȽÃǤ¹¤ëɬÍפ¬¤¢¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£
400 .\"O function modifies the fields of the
402 .\"O structure as follows:
406 .\"O are set to values determined from the contents of the other fields;
410 ¹½Â¤ÂΤγƥե£¡¼¥ë¥É¤ò°Ê²¼¤Î¤è¤¦¤Ë½¤Àµ¤¹¤ë¡£
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);
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 Æü¤ËÊѹ¹¤µ¤ì¤ë)¡£
424 ¤Ë¤Ï (ºÇ½é¤ÎÃͤˤ«¤«¤ï¤é¤º) Àµ¤ÎÃͤ« 0 ¤¬ÀßÄꤵ¤ì¤ë¡£
425 Àµ¤ÎÃͤϻØÄꤵ¤ì¤¿»þ´Ö¤Ç²Æ»þ´Ö¤¬Í¸ú¤Ç¤¢¤ë¤³¤È¤ò¼¨¤·¡¢
426 0 ¤Ï̵¸ú¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£
429 .\"O also sets the external variable \fItzname\fP with
430 .\"O information about the current timezone.
434 Âç°èÊÑ¿ô \fItzname\fP ¤¬¸½ºß¤Î¥¿¥¤¥à¥¾¡¼¥ó¤ËÀßÄꤵ¤ì¤ë¡£
436 .\"O If the specified broken-down
437 .\"O time cannot be represented as calendar time (seconds since the Epoch),
440 .\"O .I (time_t)\ \-1
441 .\"O and does not alter the
442 .\"O members of the broken-down time structure.
443 Í×ÁÇÊ̤λþ¹ï¤ò¥«¥ì¥ó¥À¡¼»þ¹ï (µª¸µ (Epoch) ¤«¤é¤ÎÉÿô) ¤Çɽ¸½¤Ç¤¤Ê¤¤¾ì¹ç¡¢
447 ¤òÊÖ¤·¡¢Í×ÁÇÊ̤λþ¹ï¤Î¹½Â¤ÂÎ¥á¥ó¥Ð¡¼¤òÊѹ¹¤·¤Ê¤¤¡£
448 .\"O .SH "RETURN VALUE"
450 .\"O Each of these functions returns the value described, or NULL
453 .\"O in case an error was detected.
454 ³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ìÁ°½Ò¤·¤¿ÃͤòÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï NULL
459 .\"O C89 and C99 specify
463 .\"O .BR localtime (),
474 .\"O POSIX.1-2008 marks
476 .\"O .BR asctime_r (),
481 .\"O recommending the use of
482 .\"O .BR strftime (3)
489 ¤òÇÑ»ßͽÄê¤È¤·¤Æ¤¤¤ë¡£
492 ¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£
495 .\"O The four functions
500 .\"O .BR localtime ()
501 .\"O return a pointer to static data and hence are not thread-safe.
506 ¤Î 4 ¤Ä¤Î´Ø¿ô¤ÏÀÅŪ¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¤Î¤Ç¡¢¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ï¤Ê¤¤¡£
507 .\"O Thread-safe versions
508 .\"O .BR asctime_r (),
512 .\"O .BR localtime_r ()
513 .\"O are specified by SUSv2, and available since libc 5.2.5.
514 ¤³¤ì¤é¤Î´Ø¿ô¤Î¥¹¥ì¥Ã¥É¥»¡¼¥ÕÈǤǤ¢¤ë
519 ¤Ï SUSv2 ¤Çµ¬Äꤵ¤ì¤Æ¤ª¤ê¡¢
520 libc 5.2.5 °Ê¹ß¤ÇÍøÍѤǤ¤ë¡£
522 .\"O POSIX.1-2001 says:
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
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 ¤Ç¤Ï¡¢¡Ö´Ø¿ô
540 ¤Ï¡¢Í×ÁÇÊ̤λþ¹ï¤Î¹½Â¤ÂΤ«
542 ·¿¤ÎÇÛÎ󤫤ΤɤÁ¤é¤«¤ÎÀÅŪ¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹¤â¤Î¤È¤¹¤ë¡£
543 ¤³¤ì¤é¤Î´Ø¿ô¤Î¤¤¤º¤ì¤«¤ò¼Â¹Ô¤¹¤ë¤È¡¢Â¾¤Î´Ø¿ô¤Î¤É¤ì¤«¤¬¤³¤ì¤é¤Î
544 ÀÅŪ¥ª¥Ö¥¸¥§¥¯¥È¤Î¤É¤Á¤é¤«¤Ë³ÊǼ¤·¤ÆÊÖ¤·¤¿¾ðÊ󤬾å½ñ¤¤µ¤ì¤ë¤«¤â
545 ¤·¤ì¤Ê¤¤¡£¡×¤È¤Ê¤Ã¤Æ¤¤¤ë¡£
546 ¤³¤Î¤³¤È¤Ï glibc ¤Î¼ÂÁõ¤Çµ¯¤³¤ê¤¦¤ë¡£
548 .\"O In many implementations, including glibc, a 0 in
550 .\"O is interpreted as meaning the last day of the preceding month.
551 glibc ¤ò´Þ¤à¿¤¯¤Î¼ÂÁõ¤Ç¤Ï¡¢
553 ¤Ë 0 ¤ò»ØÄꤹ¤ë¤ÈÁ°·î¤ÎºÇ½ªÆü¤ò°ÕÌ£¤·¤Æ¤¤¤ë¤È²ò¼á¤µ¤ì¤ë¡£
555 .\"O The glibc version of \fIstruct tm\fP has additional fields
559 .\"O long tm_gmtoff; /* Seconds east of UTC */
560 .\"O const char *tm_zone; /* Timezone abbreviation */
566 .\"O was set before including
570 ¤¬¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤ëÁ°¤Ë
573 \fIstruct tm\fP ¤Ë°Ê²¼¤Î¥Õ¥£¡¼¥ë¥É¤¬Äɲ䵤ì¤ë¡£
577 long tm_gmtoff; /* Seconds east of UTC */
578 const char *tm_zone; /* Timezone abbreviation */
582 .\"O This is a BSD extension, present in 4.3BSD-Reno.
583 ¤³¤ì¤Ï BSD ³ÈÄ¥¤Ç¤¢¤ê¡¢4.3BSD-Reno ¤«¤é¸½¤ì¤¿¡£
585 .\"O According to POSIX.1-2004,
586 .\"O .BR localtime ()
587 .\"O is required to behave as though
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
595 .\"O should be called before
596 .\"O .BR localtime_r ().
597 POSIX.1-2004 ¤Ë¤è¤ë¤È¡¢
601 ¤¬¸Æ¤Ð¤ì¤¿¤«¤Î¤è¤¦¤Ë¿¶Éñ¤¦¤³¤È¤¬Í׵ᤵ¤ì¤Æ¤¤¤ë¤¬¡¢
604 .\" http://thread.gmane.org/gmane.comp.time.tz/2034/ ¤ò»²¾È¡£
605 °Ü¿¢À¤¬É¬Íפʥ³¡¼¥É¤Ç¤Ï¡¢
609 ¤ò¸Æ¤Ó½Ð¤·¤Æ¤ª¤¯¤Ù¤¤Ç¤¢¤ë¡£
613 .BR gettimeofday (2),