OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man3 / strptime.3
1 .\" Copyright 1993 Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.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 .\" Modified, jmv@lucifer.dorms.spbu.ru, 1999-11-08
24 .\" Modified, aeb, 2000-04-07
25 .\" Updated from glibc docs, C. Scott Ananian, 2001-08-25
26 .\" Modified, aeb, 2001-08-31
27 .\" Modified, wharms 2001-11-12, remark on white space and example
28 .\"
29 .\" Japanese Version Copyright (c) 1998 SHOJI Yasushi all rights reserved.
30 .\" Translated Fri Jun 26 1998 by SHOJI Yasushi <yashi@yashi.com>
31 .\" Updated & Modefied Sun Mar 7 1999 by Shouichi Saito
32 .\" Updated Tue Oct 10 22:29:13 JST 2000
33 .\"     by Yuichi SATO <sato@complex.eng.hokudai.ac.jp>
34 .\" Updated Tue Apr  3 20:49:00 JST 2001
35 .\"     by Yuichi SATO <ysato@h4.dion.ne.jp>
36 .\" Updated Thu Oct 11 10:05:36 JST 2001 by Yuichi SATO
37 .\" Updated Fri Dec 14 16:34:23 JST 2001 by Yuichi SATO
38 .\" Updated Sat Jan  5 22:17:34 JST 2002 by Yuichi SATO
39 .\" Updated Wed Jan 14 23:21:57 JST 2002 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
40 .\"
41 .\"WORD:        modifier        ½¤Àµ»Ò
42 .\"WORD:        broken-down time        Í×ÁÇÊ̤λþ¹ï
43 .\"
44 .TH STRPTIME 3 2009-12-05 "GNU" "Linux Programmer's Manual"
45 .\"O .SH NAME
46 .SH Ì¾Á°
47 .\"O strptime \- convert a string representation of time to a time tm structure
48 strptime \- Ê¸»úÎó¤Ç¤¢¤é¤ï¤µ¤ì¤Æ¤¤¤ë»þ´Ö¤ò tm ¹½Â¤ÂΤλþ´Ö¤ËÊÑ´¹¤¹¤ë
49 .\"O .SH SYNOPSIS
50 .SH ½ñ¼°
51 .\"O .BR "#define _XOPEN_SOURCE" " /* glibc2 needs this */"
52 .BR "#define _XOPEN_SOURCE" " /* glibc2 ¤Ç¤Ï¡¢¤³¤ì¤¬É¬Íס£ */"
53 .br
54 .B #include <time.h>
55 .sp
56 .BI "char *strptime(const char *" s ", const char *" format ,
57 .BI "struct tm *" tm );
58 .\"O .SH DESCRIPTION
59 .SH ÀâÌÀ
60 .\"O The
61 .\"O .BR strptime ()
62 .\"O function is the converse function to
63 .\"O .BR strftime (3)
64 .\"O and converts the character string pointed to by
65 .\"O .I s
66 .\"O to values which are stored in the
67 .\"O .I tm
68 .\"O structure pointed to by
69 .\"O .IR tm ,
70 .\"O using the format specified by
71 .\"O .IR format .
72 .BR strptime ()
73 ´Ø¿ô¤Ï
74 .BR strftime (3)
75 ¤ÎµÕ´Ø¿ô¤Ç¤¢¤ê¡¢¥Ý¥¤¥ó¥¿
76 .I s
77 ¤¬»Ø¤¹Ê¸»úÎó¤ò»þ´Ö¤ËÊÑ´¹¤¹¤ë¡£
78 ÊÑ´¹¤ÎºÝ¤Ë¤Ï
79 .I format
80 ¤Ç»ØÄꤷ¤¿¥Õ¥©¡¼¥Þ¥Ã¥È¤òÍѤ¤¡¢Ãͤϥݥ¤¥ó¥¿
81 .I tm
82 ¤¬»Ø¤¹
83 .I tm
84 ¹½Â¤ÂΤ˼ý¤á¤é¤ì¤ë¡£
85 .\"O Here
86 .\"O .I format
87 .\"O is a character string that consists of field descriptors and text characters,
88 .\"O reminiscent of
89 .\"O .BR scanf (3).
90 .\"O Each field descriptor consists of a
91 .\"O .B %
92 .\"O character followed by another character that specifies the replacement
93 .\"O for the field descriptor.
94 .I format
95 ¤Ï¡¢
96 .BR scanf (3)
97 ¤Ç»È¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤Ê¡¢
98 ¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤È¥Æ¥­¥¹¥Èʸ»ú¤Ç¹½À®¤µ¤ì¤Æ¤¤¤ëʸ»úÎó¤Ç¤¢¤ë¡£
99 ¸Ä¡¹¤Î¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Ï
100 .B %
101 ¤È¤½¤ì¤Ë³¤¯Ê¸»ú¤«¤é¤Ê¤ê¡¢
102 ¸å¼Ô¤Ë¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤òÃÖ¤­´¹¤¨¤ëÆâÍƤò»ØÄꤹ¤ë¡£
103 .\"O All other characters in the
104 .\"O .I format
105 .\"O string must have a matching character in the input string,
106 .\"O except for whitespace, which matches zero or more
107 .\"O whitespace characters in the input string.
108 .\"O There should be white\%space or other alphanumeric characters
109 .\"O between any two field descriptors.
110 .I format
111 ʸ»úÎóÃæ¤Î¾¤ÎÁ´¤Æ¤Îʸ»ú¤Ë¤Ï¡¢ÆþÎÏʸ»úÎó¤Ë¥Þ¥Ã¥Á¤¹¤ëʸ»ú¤¬¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
112 ¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎóÃæ¤Ë¤¢¤ë¶õÇò¤ÏÎã³°¤Ç¤¢¤ê¡¢
113 ÆþÎÏʸ»úÎóÃæ¤Î 0 ¸Ä°Ê¾å¤Î¶õÇò¤È¥Þ¥Ã¥Á¤¹¤ë¡£
114 2 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤Î´Ö¤Ë¤Ï¡¢
115 ¶õÇò¡¦±Ñ»ú¡¦¿ô»ú¤¬¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
116 .PP
117 .\"O The
118 .\"O .BR strptime ()
119 .\"O function processes the input string from left
120 .\"O to right.
121 .\"O Each of the three possible input elements (whitespace,
122 .\"O literal, or format) are handled one after the other.
123 .\"O If the input cannot be matched to the format string the function stops.
124 .\"O The remainder of the format and input strings are not processed.
125 .BR strptime ()
126 ´Ø¿ô¤Ï¡¢ÆþÎÏʸ»úÎó¤òº¸¤«¤é±¦¤Ø½èÍý¤¹¤ë¡£
127 ÆþÎϤµ¤ì¤¿ 3 ¤Ä¤ÎÍ×ÁÇ (¶õÇò¡¦Ê¸»ú¡¦¥Õ¥©¡¼¥Þ¥Ã¥È) ¤Ï¡¢½ç¤Ë½èÍý¤µ¤ì¤ë¡£
128 ÆþÎϤ¬¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤È¥Þ¥Ã¥Á¤Ç¤­¤Ê¤¤¾ì¹ç¡¢´Ø¿ô¤ÏÄä»ß¤¹¤ë¡£
129 »Ä¤ê¤Î¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤ÈÆþÎÏʸ»úÎó¤Ï½èÍý¤µ¤ì¤Ê¤¤¡£
130 .PP
131 .\"O The supported input field descriptors are listed below.
132 .\"O In case a text string (such as a weekday or month name)
133 .\"O is to be matched, the comparison is case insensitive.
134 .\"O In case a number is to be matched, leading zeros are
135 .\"O permitted but not required.
136 »ÈÍѲÄǽ¤Ê¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¼¤ò°Ê²¼¤Ëµó¤²¤ë¡£
137 (ÍËÆü¤ä·î¤Î̾Á°¤È¤¤¤Ã¤¿) Ê¸»úÎó¤ò¥Þ¥Ã¥Á¤µ¤»¤ë¾ì¹ç¡¢
138 Âçʸ»ú¤È¾®Ê¸»ú¤Ï¶èÊ̤»¤º¤ËÈæ³Ó¤¹¤ë¡£
139 ¿ô¤ò¥Þ¥Ã¥Á¤µ¤»¤ë¾ì¹ç¡¢Á°¤Ë 0 ¤ò¤Ä¤±¤Æ¤â¹½¤ï¤Ê¤¤¤¬É¬¤º¤·¤âɬÍפǤϤʤ¤¡£
140 .TP
141 .B %%
142 .\"O The
143 .\"O .B %
144 .\"O character.
145 ʸ»ú¤È¤·¤Æ¤Î
146 .BR % ¡£
147 .TP
148 .\"O .BR %a " or " %A
149 .BR %a " ¤Þ¤¿¤Ï " %A
150 .\"O The weekday name according to the current locale,
151 .\"O in abbreviated form or the full name.
152 ¸½ºß¤Î¥í¥±¡¼¥ë¤Ç¤ÎÍËÆü̾ (¾Êά̾¤Þ¤¿¤Ï´°Á´¤Ê̾Á°)¡£
153 .TP
154 .\"O .BR %b " or " %B " or " %h
155 .BR %b " ¤Þ¤¿¤Ï " %B " ¤Þ¤¿¤Ï " %h
156 .\"O The month name according to the current locale,
157 .\"O in abbreviated form or the full name.
158 ¸½ºß¤Î¥í¥±¡¼¥ë¤Ç¤Î·î̾ (¾Êά̾¤Þ¤¿¤Ï´°Á´¤Ê̾Á°)¡£
159 .TP
160 .B %c
161 .\"O The date and time representation for the current locale.
162 ¸½ºß¤Î¥í¥±¡¼¥ë¤Ç¤ÎÆüÉդȻþ¹ï¤Îɽ¸½¡£
163 .TP
164 .B %C
165 .\"O The century number (0-99).
166 1 À¤µªÃæ¤Îǯ (0-99)¡£
167 .TP
168 .\"O .BR %d " or " %e
169 .BR %d " ¤Þ¤¿¤Ï " %e
170 .\"O The day of month (1-31).
171 ·îÆâ¤ÎÆüÉÕ (1-31)¡£
172 .TP
173 .B %D
174 .\"O Equivalent to
175 .\"O .BR %m/%d/%y .
176 .\"O (This is the American style date, very confusing
177 .\"O to non-Americans, especially since
178 .\"O .B %d/%m/%y
179 .\"O is widely used in Europe.
180 .\"O The ISO 8601 standard format is
181 .\"O .BR %Y-%m-%d .)
182 ÆüÉÕ¡£
183 .B %m/%d/%y
184 ¤ÈƱ¤¸¡£
185 (¤³¤ì¤Ï¥¢¥á¥ê¥«¼°¤ÎÆüÉÕ·Á¼°¤Ç¡¢
186 ¥è¡¼¥í¥Ã¥Ñ¤Ç¤ÏÆäË
187 .B %d/%m/%y
188 ¤È¤¤¤¦·Á¼°¤¬¹­¤¯»È¤ï¤ì¤Æ¤¤¤ë¤¿¤á¤Ë¡¢
189 ¥¢¥á¥ê¥«¿Í°Ê³°¤Ë¤Ïʶ¤é¤ï¤·¤¯´¶¤¸¤é¤ì¤ë¡£
190 ISO 8601 µ¬³Ê¤Ç¤Ï
191 .B %Y-%m-%d
192 ¤È¤¤¤¦·Á¼°¤Ç¤¢¤ë¡£)
193 .TP
194 .B %H
195 .\"O The hour (0-23).
196 »þ´Ö (0-23)¡£
197 .TP
198 .B %I
199 .\"O The hour on a 12-hour clock (1-12).
200 12 »þ´ÖÀ©¤Ç¤Î»þ´Ö (1-12)¡£
201 .TP
202 .B %j
203 .\"O The day number in the year (1-366).
204 ǯ¤Î½é¤á¤«¤é¤ÎÄÌ»»¤ÎÆüÉÕ (1-366)¡£
205 .TP
206 .B %m
207 .\"O The month number (1-12).
208 ¿ô»úɽ¸½¤Î·î (1-12)¡£
209 .TP
210 .B %M
211 .\"O The minute (0-59).
212 ʬ (0-59)¡£
213 .TP
214 .B %n
215 .\"O Arbitrary whitespace.
216 Ǥ°Õ¤Î¶õÇò¡£
217 .TP
218 .B %p
219 .\"O The locale's equivalent of AM or PM.
220 .\"O (Note: there may be none.)
221 ¥í¥±¡¼¥ë¤Î AM (¸áÁ°) ¤È PM (¸á¸å) ¤ËÂбþ¤¹¤ë¤â¤Î¡£
222 (Ãí°Õ: Âбþ¤¹¤ë¤â¤Î¤¬¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£)
223 .TP
224 .B %r
225 .\"O The 12-hour clock time (using the locale's AM or PM).
226 .\"O In the POSIX locale equivalent to
227 .\"O .BR "%I:%M:%S %p" .
228 .\"O If \fIt_fmt_ampm\fP is empty in the
229 .\"O .B LC_TIME
230 .\"O part of the current locale
231 .\"O then the behavior is undefined.
232 (¥í¥±¡¼¥ë¤Î AM ¤È PM ¤ò»È¤Ã¤¿) 12 »þ´ÖÀ©¤Î»þ´Ö¡£
233 POSIX ¥í¥±¡¼¥ë¤Ç¤Ï
234 .B %I:%M:%S %p
235 ¤ÈƱ¤¸¡£
236 ¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¤ª¤¤¤Æ
237 .B LC_TIME
238 ¥Ñ¡¼¥È¤Î
239 \fIt_fmt_ampm\fP ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
240 Æ°ºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£
241 .TP
242 .B %R
243 .\"O Equivalent to
244 .\"O .BR %H:%M .
245 .B %H:%M
246 ¤ÈƱ¤¸¡£
247 .TP
248 .B %S
249 .\"O The second (0-60; 60 may occur for leap seconds;
250 .\"O earlier also 61 was allowed).
251 Éà(0-60; 60 ¤Ï±¼Éäò¼¨¤¹¡£°ÊÁ°¤Ï 61 ¤â»ØÄê¤Ç¤­¤¿)¡£
252 .TP
253 .B %t
254 .\"O Arbitrary whitespace.
255 Ǥ°Õ¤Î¶õÇò¡£
256 .TP
257 .B %T
258 .\"O Equivalent to
259 .\"O .BR %H:%M:%S .
260 .B %H:%M:%S
261 ¤ÈƱ¤¸¡£
262 .TP
263 .B %U
264 .\"O The week number with Sunday the first day of the week (0-53).
265 .\"O The first Sunday of January is the first day of week 1.
266 ÆüÍËÆü¤ò½µ¤Î»Ï¤Þ¤ê¤È¤·¤¿Ç¯ÄÌ»»¤Ç¤Î½µ¿ô (0-53)¡£
267 1 ·î¤ÎºÇ½é¤ÎÆüÍËÆü¤òÂè 1 ½µÌܤκǽé¤ÎÆü¤¹¤ë¡£
268 .TP
269 .B %w
270 .\"O The weekday number (0-6) with Sunday = 0.
271 ÆüÍËÆü¤ò 0 ¤È¤·¤¿¿ô»úɽµ­¤ÎÍËÆü (0-6)¡£
272 .TP
273 .B %W
274 .\"O The week number with Monday the first day of the week (0-53).
275 .\"O The first Monday of January is the first day of week 1.
276 ·îÍËÆü¤ò½µ¤Î»Ï¤Þ¤ê¤È¤·¤¿Ç¯ÄÌ»»¤Ç¤Î½µ¿ô (0-53)¡£
277 1 ·î¤ÎºÇ½é¤Î·îÍËÆü¤òÂè 1 ½µÌܤκǽé¤ÎÆü¤¹¤ë¡£
278 .TP
279 .B %x
280 .\"O The date, using the locale's date format.
281 ÆüÉÕ¡£¥í¥±¡¼¥ë¤ÎÆüÉÕ¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»È¤¦¡£
282 .TP
283 .B %X
284 .\"O The time, using the locale's time format.
285 »þ¹ï¡£¥í¥±¡¼¥ë¤Î»þ¹ï¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»È¤¦¡£
286 .TP
287 .B %y
288 .\"O The year within century (0-99).
289 .\"O When a century is not otherwise specified, values in the range 69-99 refer
290 .\"O to years in the twentieth century (1969-1999); values in the
291 .\"O range 00-68 refer to years in the twenty-first century (2000-2068).
292 1 À¤µªÃæ¤Îǯ (0-99)¡£
293 À¤µª¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢
294 Ãͤ¬ 69-99 ¤ÎÈϰϤΤȤ­¤Ï 20 À¤µª¤Îǯ (1969-1999)¡¢
295 Ãͤ¬ 00-68 ¤ÎÈϰϤΤȤ­¤Ï 21 À¤µª¤Îǯ (2000-2068) ¤È¤¹¤ë¡£
296 .TP
297 .B %Y
298 .\"O The year, including century (for example, 1991).
299 ǯ¡£À¤µª¤ÎÉôʬ¤ò´Þ¤à (Îã: 1991)¡£
300 .LP
301 .\"O Some field descriptors can be modified by the E or O modifier characters
302 .\"O to indicate that an alternative format or specification should be used.
303 .\"O If the
304 .\"O alternative format or specification does not exist in the current locale, the
305 .\"O unmodified field descriptor is used.
306 E ¤ä O ¤È¤¤¤¦½¤Àµ»Ò¤ò»È¤¦¤³¤È¤ÇÊѹ¹¤Ç¤­¤ë¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¤â¤¢¤ë¡£
307 ¤³¤ì¤é¤Î½¤Àµ»Ò¤Ï¡¢Ê̤Υե©¡¼¥Þ¥Ã¥È¤ä»ÅÍͤò»È¤¦¤³¤È¤ò»Ø¼¨¤¹¤ë¡£
308 Ê̤Υե©¡¼¥Þ¥Ã¥È¤ä»ÅÍͤ¬¸½ºß¤Î¥í¥±¡¼¥ë¤Ë¸ºß¤·¤Ê¤¤¤È¤­¤Ï¡¢
309 Êѹ¹¤·¤Æ¤¤¤Ê¤¤¥Õ¥£¡¼¥ë¥É¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬»È¤ï¤ì¤ë¡£
310 .LP
311 .\"O The E modifier specifies that the input string may contain
312 .\"O alternative locale-dependent versions of the date and time representation:
313 E ½¤Àµ»Ò¤Ï¡¢¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿ÆüÉդȻþ¹ï¤ÎÊ̤Îɽ¸½·Á¼°¤¬
314 ÆþÎÏʸ»úÎó¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤³¤È¤ò»ØÄꤹ¤ë¡£
315 .TP
316 .B %Ec
317 .\"O The locale's alternative date and time representation.
318 ÆüÉդȻþ¹ï¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Îɽ¸½·Á¼°¤ò»È¤¦¡£
319 .TP
320 .B %EC
321 .\"O The name of the base year (period) in the locale's alternative representation.
322 ´ð½àǯ (´ü´Ö) ¤Î̾Á°¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Îɽ¸½·Á¼°¤ò»È¤¦¡£
323 .TP
324 .B %Ex
325 .\"O The locale's alternative date representation.
326 ÆüÉÕ¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Îɽ¸½·Á¼°¤ò»È¤¦¡£
327 .TP
328 .B %EX
329 .\"O The locale's alternative time representation.
330 »þ¹ï¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Îɽ¸½·Á¼°¤ò»È¤¦¡£
331 .TP
332 .B %Ey
333 .\"O The offset from
334 .\"O .B %EC
335 .\"O (year only) in the locale's alternative representation.
336 .B %EC
337 (ǯ¤Î¤ß) ¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Îɽ¸½·Á¼°¤ò»È¤¦¡£
338 .TP
339 .B %EY
340 .\"O The full alternative year representation.
341 ´°Á´¤Ê·Á¼°¤Îǯ¡£Ê̤Îɽ¸½·¿¼°¤ò»È¤¦¡£
342 .LP
343 .\"O The O modifier specifies that the numerical input may be in an
344 .\"O alternative locale-dependent format:
345 O ½¤Àµ»Ò¤Ï¡¢¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤Υե©¡¼¥Þ¥Ã¥È¤ÎÃæ¤Ë
346 ¿ôÃͤÎÆþÎϤ¬¤¢¤ë¤³¤È¤ò»ØÄꤹ¤ë¡£
347 .TP
348 .\"O .BR %Od " or " %Oe
349 .BR %Od " ¤Þ¤¿¤Ï " %Oe
350 .\"O The day of the month using the locale's alternative numeric symbols;
351 .\"O leading zeros are permitted but not required.
352 ·î¤Î½é¤á¤«¤é¤ÎÄÌ»»¤ÎÆüÉÕ¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£
353 0 ¤òƬ¤Ë¤Ä¤±¤Æ¤â¤è¤¤¤¬¡¢É¬¿Ü¤Ç¤Ï¤Ê¤¤¡£
354 .TP
355 .B %OH
356 .\"O The hour (24-hour clock) using the locale's alternative numeric symbols.
357 »þ´Ö (24 »þ´ÖÀ©)¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£
358 .TP
359 .B %OI
360 .\"O The hour (12-hour clock) using the locale's alternative numeric symbols.
361 »þ´Ö (12 »þ´ÖÀ©)¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£
362 .TP
363 .B %Om
364 .\"O The month using the locale's alternative numeric symbols.
365 ·î¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£
366 .TP
367 .B %OM
368 .\"O The minutes using the locale's alternative numeric symbols.
369 ʬ¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£
370 .TP
371 .B %OS
372 .\"O The seconds using the locale's alternative numeric symbols.
373 Éá£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£
374 .TP
375 .B %OU
376 .\"O The week number of the year (Sunday as the first day of the week)
377 .\"O using the locale's alternative numeric symbols.
378 ǯ¤Î½é¤á¤«¤é¤ÎÄÌ»»¤Î½µ¿ô (ÆüÍËÆü¤ò½µ¤Î»Ï¤á¤È¤¹¤ë)¡£
379 ¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£
380 .TP
381 .B %Ow
382 .\"O The number of the weekday (Sunday=0) using the locale's alternative
383 .\"O numeric symbols.
384 ¿ôÃÍɽµ­¤ÎÍËÆü (ÆüÍËÆü¤ò 0 ¤È¤¹¤ë)¡£
385 ¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£
386 .TP
387 .B %OW
388 .\"O The week number of the year (Monday as the first day of the week)
389 .\"O using the locale's alternative numeric symbols.
390 ǯ¤Î½é¤á¤«¤é¤ÎÄÌ»»¤Î½µ¿ô (·îÍËÆü¤ò½µ¤Î»Ï¤á¤È¤¹¤ë)¡£
391 ¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£
392 .TP
393 .B %Oy
394 .\"O The year (offset from %C) using the locale's alternative numeric symbols.
395 .\"O The year (offset from
396 .\"O .BR %C )
397 .\"O using the locale's alternative numeric symbols.
398 ǯ
399 .RB ( %C
400 ¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È)¡£¥í¥±¡¼¥ë¤Ë°Í¸¤·¤¿Ê̤οôÃÍ¥·¥ó¥Ü¥ë¤ò»È¤¦¡£
401 .LP
402 .\"O The broken-down time structure \fItm\fP is defined in \fI<time.h>\fP
403 .\"O as follows:
404 Í×ÁÇÊ̤λþ¹ï¹½Â¤ÂΠ\fItm\fP ¤Ï
405 \fI<time.h>\fP Æâ¤Ç°Ê²¼¤ÎÍͤËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
406 .sp
407 .in +4n
408 .nf
409 .\"O struct tm {
410 .\"O     int tm_sec;        /* seconds */
411 .\"O     int tm_min;        /* minutes */
412 .\"O     int tm_hour;       /* hours */
413 .\"O     int tm_mday;       /* day of the month */
414 .\"O     int tm_mon;        /* month */
415 .\"O     int tm_year;       /* year */
416 .\"O     int tm_wday;       /* day of the week */
417 .\"O     int tm_yday;       /* day in the year */
418 .\"O     int tm_isdst;      /* daylight saving time */
419 .\"O };
420 struct tm {
421     int tm_sec;        /* Éà*/
422     int tm_min;        /* ʬ */
423     int tm_hour;       /* »þ´Ö */
424     int tm_mday;       /* Æü */
425     int tm_mon;        /* ·î */
426     int tm_year;       /* ǯ */
427     int tm_wday;       /* ÍËÆü */
428     int tm_yday;       /* Ç¯ÆâÄÌ»»Æü */
429     int tm_isdst;      /* ²Æ»þ´Ö */
430 };
431 .fi
432 .in
433 .\"O .SH "RETURN VALUE"
434 .SH ÊÖ¤êÃÍ
435 .\"O The return value of the function is a pointer to the first character
436 .\"O not processed in this function call.
437 .\"O In case the input string
438 .\"O contains more characters than required by the format string the return
439 .\"O value points right after the last consumed input character.
440 .\"O In case
441 .\"O the whole input string is consumed the return value points to the null
442 .\"O byte at the end of the string.
443 .\"O If
444 .\"O .BR strptime ()
445 .\"O fails to match all
446 .\"O of the format string and therefore an error occurred the function
447 .\"O returns NULL.
448 ¤³¤Î´Ø¿ô¤ÎÊÖ¤êÃͤϡ¢´Ø¿ô¤ÎÃæ¤Ç½èÍý¤µ¤ì¤Ê¤«¤Ã¤¿ºÇ½é¤Îʸ»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
449 ¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤¬É¬Íפ¹¤ë°Ê¾å¤Îʸ»ú¤¬ÆþÎÏʸ»úÎó¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢
450 ÊÖ¤êÃͤϺǸå¤Ë½èÍý¤µ¤ì¤¿ÆþÎÏʸ»ú¤Î¼¡¤Îʸ»ú¤ò»Ø¤¹¡£
451 ¤¹¤Ù¤Æ¤ÎÆþÎÏʸ»úÎ󤬽èÍý¤µ¤ì¤¿¾ì¹ç¡¢
452 ÊÖ¤êÃͤÏʸ»úÎóËöÈø¤Î NULL ¥Ð¥¤¥È¤ò»Ø¤¹¡£
453 .BR strptime ()
454 ¤¬¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Î¤¹¤Ù¤Æ¤ÎÈæ³Ó¤Ë¼ºÇÔ¤·¡¢
455 ¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢´Ø¿ô¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
456 .\"O .SH "CONFORMING TO"
457 .SH ½àµò
458 SUSv2, POSIX.1-2001.
459 .\"O .SH NOTES
460 .SH Ãí°Õ
461 .LP
462 .\"O In principle, this function does not initialize \fItm\fP but
463 .\"O only stores the values specified.
464 .\"O This means that \fItm\fP should be initialized before the call.
465 .\"O Details differ a bit between different Unix systems.
466 .\"O The glibc implementation does not touch those fields which are not
467 .\"O explicitly specified, except that it recomputes the
468 .\"O .I tm_wday
469 .\"O and
470 .\"O .I tm_yday
471 .\"O field if any of the year, month, or day elements changed.
472 ¸¶Â§¤È¤·¤Æ¡¢¤³¤Î´Ø¿ô¤Ï \fItm\fP ¤Î½é´ü²½¤Ï¤»¤º¤Ë¡¢
473 »ØÄꤵ¤ì¤¿ÃͤΤߤòÆþ¤ì¤ë¡£
474 ¤Ä¤Þ¤ê¡¢¤³¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë \fItm\fP ¤ò½é´ü²½¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
475 ¾¤Î Unix ¥·¥¹¥Æ¥à¤È¤Ï¡¢ºÙ¤«¤¤ÅÀ¤Ç°Û¤Ê¤ë¡£
476 glibc ¤Î¼ÂÁõ¤Ç¤Ï¡¢ÌÀ¼¨Åª¤Ë»ØÄꤵ¤ì¤Ê¤¤¥Õ¥£¡¼¥ë¥É¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£
477 Îã³°¤È¤·¤Æ¡¢Ç¯¡¦·î¡¦Æü¤Î¤¤¤º¤ì¤«¤ÎÍ×ÁǤ¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¤Ë
478 .I tm_wday
479 ¤È
480 .I tm_yday
481 ¤¬ºÆ·×»»¤µ¤ì¤ë¡£
482 .PP
483 .\"O This function is available since libc 4.6.8.
484 .\"O Linux libc4 and libc5 includes define the prototype unconditionally;
485 .\"O glibc2 includes provide a prototype only when
486 .\"O .B _XOPEN_SOURCE
487 .\"O or
488 .\"O .B _GNU_SOURCE
489 .\"O are defined.
490 ¤³¤Î´Ø¿ô¤Ï¡¢libc 4.6.8 °Ê¹ß¤Ç»ÈÍѤǤ­¤ë¡£
491 Linux ¤Î libc4 ¤È libc5 ¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ï¡¢
492 ¤³¤Î´Ø¿ô¤Î¥×¥í¥È¥¿¥¤¥×¤ò¾ï¤ËÄêµÁ¤¹¤ë¡£
493 glibc2 ¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ï¡¢
494 .B _XOPEN_SOURCE
495 ¤Þ¤¿¤Ï
496 .B _GNU_SOURCE
497 ¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Î¤ß¡¢
498 ¤³¤Î´Ø¿ô¤Î¥×¥í¥È¥¿¥¤¥×¤òÄ󶡤¹¤ë¡£
499 .PP
500 .\"O Before libc 5.4.13 whitespace
501 .\"O (and the \(aqn\(aq and \(aqt\(aq specifications) was not handled,
502 .\"O no \(aqE\(aq and \(aqO\(aq locale modifier characters were accepted,
503 .\"O and the \(aqC\(aq specification was a synonym for the \(aqc\(aq specification.
504 libc 5.4.13 ¤è¤êÁ°¤Ç¤Ï¡¢¶õÇò (¤È \(aqn\(aq ¤Þ¤¿¤Ï \(aqt\(aq »ØÄê) ¤Ï°·¤ï¤ì¤Ê¤«¤Ã¤¿¡£
505 ¥í¥±¡¼¥ë¤Î½¤Àµ»Ò \(aqE\(aq ¤È \(aqO\(aq ¤Ï¼õ¤±ÉÕ¤±¤é¤ì¤Ê¤«¤Ã¤¿¡£
506 ¤Þ¤¿¡¢\(aqC\(aq ¤Î»ØÄê¤Ï \(aqc\(aq ¤Î»ØÄê¤ÈƱ¤¸°ÕÌ£¤Ç°·¤ï¤ì¤¿¡£
507 .PP
508 .\"O The \(aqy\(aq (year in century) specification is taken to specify a year
509 .\"O in the 20th century by libc4 and libc5.
510 .\"O It is taken to be a year
511 .\"O in the range 1950-2049 by glibc 2.0.
512 .\"O It is taken to be a year in
513 .\"O 1969-2068 since glibc 2.1.
514 \(aqy\(aq (1 À¤µªÃæ¤Îǯ) ¤Î»ØÄê¤Ï¡¢libc4 ¤È libc5 ¤Ç¤Ï 20 À¤µª¤Îǯ¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£
515 glibc 2.0 ¤Ç¤Ï 1950-2049 ¤ÎÈϰϤȤ·¤Æ²ò¼á¤µ¤ì¤ë¡£
516 glibc 2.1 ¤«¤é¤Ï 1969-2068 ¤ÎÈϰϤȤ·¤Æ²ò¼á¤µ¤ì¤ë¡£
517 .\"O .\" In libc4 and libc5 the code for %I is broken (fixed in glibc;
518 .\"O .\" %OI was fixed in glibc 2.2.4).
519 .\" libc4 ¤È libc5 ¤Ç¤Ï %I ÍѤΥ³¡¼¥É¤¬²õ¤ì¤Æ¤¤¤ë (glibc ¤Ç½¤Àµ¤µ¤ì¤¿;
520 .\" %OI ¤Ï glibc 2.2.4 ¤Ç½¤Àµ¤µ¤ì¤¿)¡£
521 .\"O .SS Glibc Notes
522 .SS glibc ¤Ç¤ÎÃí°Õ
523 .\"O For reasons of symmetry, glibc tries to support for
524 .\"O .BR strptime ()
525 .\"O the same format characters as for
526 .\"O .BR strftime (3).
527 ÂоÝÀ­¤Î¤¿¤á¤Ë¡¢glibc ¤Ç¤Ï
528 .BR strptime ()
529 ¤Ë
530 .BR strftime (3)
531 ¤ÈƱ¤¸¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»ú¤ò¥µ¥Ý¡¼¥È¤µ¤»¤è¤¦¤È¤·¤Æ¤¤¤ë¡£
532 .\"O In most cases the corresponding fields are parsed, but no field in \fItm\fP
533 .\"O is changed.)
534 .\"O This leads to
535 ¿¤¯¤Î¾ì¹ç¡¢Âбþ¤¹¤ë¥Õ¥£¡¼¥ë¥É¤¬²ò¼á¤µ¤ì¤ë¤¬¡¢
536 \fItm\fP ¥Õ¥£¡¼¥ë¥É¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£
537 »ÈÍѲÄǽ¤Ê¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»ú¤ò°Ê²¼¤Ë¼¨¤¹¡£
538 .TP
539 .B %F
540 .\"O Equivalent to \fB%Y-%m-%d\fP, the ISO 8601 date format.
541 \fB%Y-%m-%d\fP ¤ÈƱ¤¸¡£ISO 8601 ¤ÎÆüÉÕ·Á¼°¡£
542 .TP
543 .B %g
544 .\"O The year corresponding to the ISO week number, but without the century
545 .\"O (0-99).
546 ISO ½µ¿ô¤ËÂбþ¤·¤¿À¾Îñǯ¡£À¤µª¤Ï´Þ¤Þ¤º (0-99) ¤ÎÈÏ°Ï¡£
547 .TP
548 .B %G
549 .\"O The year corresponding to the ISO week number.
550 .\"O (For example, 1991.)
551 ISO ½µ¿ô¤ËÂбþ¤·¤¿À¾Îñǯ (Î㤨¤Ð 1991)¡£
552 .TP
553 .B %u
554 .\"O The day of the week as a decimal number (1-7, where Monday = 1).
555 10 ¿Ê¿ôɽµ­¤ÎÍËÆü (1-7 ¤Ç·îÍËÆü¤ò 1 ¤È¤¹¤ë)¡£
556 .TP
557 .B %V
558 .\"O The ISO 8601:1988 week number as a decimal number (1-53).
559 .\"O If the week (starting on Monday) containing 1 January has four or more days
560 .\"O in the new year, then it is considered week 1.
561 .\"O Otherwise, it is the last week
562 .\"O of the previous year, and the next week is week 1.
563 ISO 8601:1988 ·Á¼°¤Ç¤ÎǯÄÌ»»¤Î 10 ¿Ê¿ôɽµ­¤Ç¤Î½µ¿ô (1-53)¡£
564 1 ·î 1 Æü¤ò´Þ¤à (·îÍËÆü¤«¤é»Ï¤Þ¤ë) ½µ¤Ë 4 Æü°Ê¾å¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢
565 ¤½¤Î½µ¤òÂè 1 ½µ¤È¤¹¤ë¡£
566 3 Æü°Ê²¼¤·¤«´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢1 ·î 1 Æü¤ò´Þ¤à½µ¤òÁ°Ç¯¤ÎºÇ½ª¤Î½µ¤È¤·¤Æ¡¢
567 ¼¡¤Î½µ¤òÂè 1 ½µ¤È¤¹¤ë¡£
568 .TP
569 .B %z
570 .\"O An RFC-822/ISO 8601 standard timezone specification.
571 RFC-822/ISO 8601 É¸½à¥¿¥¤¥à¥¾¡¼¥ó¤ò»ØÄꤹ¤ë¡£
572 .TP
573 .B %Z
574 .\"O The timezone name.
575 ¥¿¥¤¥à¥¾¡¼¥ó̾¡£
576 .LP
577 .\"O Similarly, because of GNU extensions to
578 .\"O .BR strftime (3),
579 .\"O .B %k
580 .\"O is accepted as a synonym for
581 .\"O .BR %H ,
582 .\"O and
583 .\"O .B %l
584 .\"O should be accepted
585 .\"O as a synonym for
586 .\"O .BR %I ,
587 .\"O and
588 .\"O .B %P
589 .\"O is accepted as a synonym for
590 .\"O .BR %p .
591 ƱÍͤˡ¢
592 .BR strftime (3)
593 ¤Î GNU ÈǤǤγÈÄ¥¤ËÂбþ¤¹¤ë¤¿¤á¤Ë¡¢
594 .B %k
595 ¤Ï
596 .B %H¡¢
597 .B %P
598 ¤Ï
599 .B %p
600 ¤ÈÅù²Á¤Ë°·¤ï¤ì¤ë¡£¤Þ¤¿¡¢
601 .B %l
602 ¤Ï
603 .B %I
604 ¤ÈÅù²Á¤Ë°·¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¤Ï¤º¤Ç¤¢¤ë¡£
605
606 .\"O Finally
607 ¤µ¤é¤Ë°Ê²¼¤âÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
608 .TP
609 .B %s
610 .\"O The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
611 .\"O Leap seconds are not counted unless leap second support is available.
612 µª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC)) ¤«¤é¤ÎÄÌ»»¤ÎÉÿô¡£
613 ±¼É䬥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¸Â¤ê¡¢±¼Éäϥ«¥¦¥ó¥È¤·¤Ê¤¤¡£
614 .LP
615 .\"O The glibc implementation does not require whitespace between
616 .\"O two field descriptors.
617 glibc ¤Ë¤ª¤±¤ë¼ÂÁõ¤Ç¤Ï¡¢2 ¤Ä¤Î¥Õ¥£¡¼¥ë¥É´Ö¤Î¶õÇò¤ÏɬÍפʤ¤¡£
618 .\"O .SH EXAMPLE
619 .SH Îã
620 .\"O The following example demonstrates the use of
621 .\"O .BR strptime ()
622 .\"O and
623 .\"O .BR strftime (3).
624 °Ê²¼¤ÎÎã¤Ï
625 .BR strptime ()
626 ¤È
627 .BR strftime (3)
628 ¤Î»ÈÍÑË¡¤ò¼¨¤·¤Æ¤¤¤ë¡£
629 .sp
630 .nf
631 #define _XOPEN_SOURCE
632 #include <stdio.h>
633 #include <stdlib.h>
634 #include <string.h>
635 #include <time.h>
636
637 int
638 main(void)
639 {
640     struct tm tm;
641     char buf[255];
642
643     memset(&tm, 0, sizeof(struct tm));
644     strptime("2001\-11\-12 18:31:01", "%Y\-%m\-%d %H:%M:%S", &tm);
645     strftime(buf, sizeof(buf), "%d %b %Y %H:%M", &tm);
646     puts(buf);
647     exit(EXIT_SUCCESS);
648 }
649 .fi
650 .\"O .SH "SEE ALSO"
651 .SH ´ØÏ¢¹àÌÜ
652 .BR time (2),
653 .BR getdate (3),
654 .BR scanf (3),
655 .BR setlocale (3),
656 .BR strftime (3),
657 .BR feature_test_macros (7)