File: strftime.3

package info (click to toggle)
manpages-ja 0.5.0.0.20050315-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,620 kB
  • ctags: 4
  • sloc: sh: 12,675; perl: 157; makefile: 106
file content (281 lines) | stat: -rw-r--r-- 8,498 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" References consulted:
.\"     Linux libc source code
.\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
.\"     386BSD man pages
.\"     GNU texinfo documentation on glibc date/time functions.
.\" Modified Sat Jul 24 18:03:44 1993 by Rik Faith (faith@cs.unc.edu)
.\" Applied fix by Wolfgang Franke, aeb, 961011
.\" Corrected return value, aeb, 970307
.\" Added Single Unix Spec conversions and %z, aeb/esr, 990329.
.\"
.\" Japanese Version Copyright (c) 2000 HANATAKA Shinya
.\"         all rights reserved.
.\" Translated 2000-10-10, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Updated 2002-01-09, Kentaro Shirakata <argrath@ub32.org>
.\" Updated 2002-01-14, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\" Updated 2005-02-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\"
.\"WORD:	modifier		
.\"WORD:	broken-down time	̤()
.\"WORD:	Single Unix Specification	 Unix 
.\"
.TH STRFTIME 3  1999-03-29 "GNU" "Linux Programmer's Manual"
.SH ̾
strftime \- դӻʸؤѴ
.SH 
.nf
.B #include <time.h>
.sp
.BI "size_t strftime(char *" s ", size_t " max ", const char *" format ,
.BI "				const struct tm *" tm );
.fi
.SH 
\fBstrftime()\fP ؿ ϡ̤λ \fItm\fP Ƥ
\fIformat\fP ǻꤵ줿񼰻ˤäѴ
Ĺ \fImax\fP ʸ \fIs\fP ˽񤭹ࡣ
.PP
ʸ˴ޤޤ̾ʸѴ줺Τޤʸ \fIs\fP 
˥ԡ롣Ѵλ `%' ʸǼʲΤ褦Ѵ
 \fIs\fP ˳Ǽ:
.TP
.B %a
ߤΥˤξά̾
.TP
.B %A
ߤΥˤδ̾
.TP
.B %b
ߤΥˤξά̾
.TP
.B %B
ߤΥˤδ̾
.TP
.B %c
ߤΥˤưŪաɽ
.TP
.B %C
 (ǯξ 2 ) (SU)
.TP
.B %d
̻ (10 ʿɽ) (01-31)
.TP
.B %D
%m/%d/%y (áꥫѤꥫʳιǤ
%d/%m/%y ŪĤޤꡢդˤäƤϤɤ餫ȽǤǤʤ
Τǹݲ줿ʸ̮ǤϻѤʤۤ) (SU)
.TP
.B %e
%d Ʊͤ˷̻ 10 ʿɽ뤬
1 ξ 10 ΰ̤˥֤ڡ֤(SU)
.TP
.B %E
̷Ѥݤνҡȡ (SU)
.TP
.B %F
%Y-%m-%d  (ISO 8601 եեޥå) (C99)
.TP
.B %G
ISO 8601 ǯ ( 10 ʿɽ)
ISO  (%V 򻲾) б 4 ǯ
ϴŪˤ %y ƱISO ǯǯˤʤ
ˤϤǯѤ롣(TZ)
.TP
.B %g
%G Ʊ͡âޤޤ 2 Τߤɽ (00-99) (TZ)
.TP
.B %h
%b  (SU)
.TP
.B %H
24 ɽǤλ (hour) (00-23)
.TP
.B %I
12 ɽǤλ (hour) (01-12)
.TP
.B %j
ǯνᤫ̻ (001-366)
.TP
.B %k
24 ɽǤλ (0-23)
1 ξˤ˥Ǥʤڡ֤롣(%H ⻲) (TZ)
.TP
.B %l
12 ɽǤλ (0-12)
1 ξˤ˥Ǥʤڡ֤롣(%I ⻲) (TZ)
.TP
.B %m
 (10 ʿɽ) (01-12)
.TP
.B %M
ʬ (10 ʿɽ) (00-59)
.TP
.B %n
ԡ (SU)
.TP
.B %O
̷Ѥݤνҡʲ򻲾ȡ(SU)
.TP
.B %p
ߤΥˤָסָפʸ
Ѹξˤ 'AM' ޤ 'PM' Ȥʤ롣
ϸ塢ϸȤư롣
.TP
.B %P
%p ƱͤǤ뤬ʸѤ롣
Ѹξˤ 'am'  'pm' Ȥʤ롣(GNU)
.TP
.B %r
Ǥλ
POSIX Ǥ `%I:%M:%S %p' Ǥ롣(SU)
.TP
.B %R
24 ɽǤλäɽʤ (%H:%M)(SU)
äޤΤϰʲ %T 򻲾Ȥ뤳ȡ
.TP
.B %s
 (1970ǯ 1  1  00:00:00 UTC) ÿ (TZ)
.TP
.B %S
 (10 ʿɽ) (00-60)
(뱼äб뤿ᡢͤϰϤ 60 ޤǤȤʤäƤ)
.TP
.B %t
ʸ (SU)
.TP
.B %T
24 ɽλ (%H:%M:%S) (SU)
.TP
.B %u
βܤ (10 ʿɽ)  1 Ȥ (1-7)
%w ⻲ȡ(SU)
.TP
.B %U
ǯνᤫ̻ν (10 ʿɽ) (00-53)
ǯκǽ 1 λϤޤȤƷ׻롣
%V  %W ⻲Ȥ뤳ȡ
.TP
.B %V
ISO 8601:1988 ǤǯλϤᤫν (10 ʿɽ) (00-53)
ǯ˾ʤȤ 4 ʾޤޤǽν 1 ȤƷ׻롣
λϤޤϷȤ롣%U  %W ⻲Ȥ뤳ȡ
.TP
.B %w
βܤ (10 ʿɽ)  0 Ȥ롣(0-6)
%u ⻲ȡ(SU)
.TP
.B %W
ǯνᤫ̻ν (10 ʿɽ) (00-53)
ǯκǽη 1 λϤޤȤƷ׻롣
.TP
.B %x
ߤΥǰŪɽϴޤޤʤ
.TP
.B %X
ߤΥǰŪʻɽդϴޤޤʤ
.TP
.B %y
β2 (ʬޤޤʤǯ) (00-99)
.TP
.B %Y
ʬޤ᤿ ( 4 ) ǯ
.TP
.B %z
ॾ GMT ؤΥեåȻ֡
RFC822 ɬפǤ롣
("%a, %d %b %Y %H:%M:%S %z" ȤƻѤ)(GNU)
.TP
.B %Z
ॾޤϥ̾ޤϾά̾
.TP
.B %+
date(1) Ǥ(TZ)
.TP
.B %%
`%' ʸ
.PP
ĤѴ E  O ֤Ȥˤä̽񼰤Ѥ
褦˻ꤹ뤳ȤǤ롣
ߤΥˤ̽񼰤¸ߤʤˤϡ
̾Ѵ꤬Ѥ줿Τ褦ư (SU)
 UNIX  (Single Unix Specification) Ǥ %Ec, %EC, %Ex, %EX,
%Ry, %EY, %Od, %Oe, %OH, %OI, %Om, %OM, %OS, %Ou, %OU, %OV
ˤĤƵҤ롣 O Ҥ̷ο (޿Ȥ) 
ꤹ뤿˻Ѥ롣E Ҥϥ¸ɽꤹ
˻Ѥ롣(: E ҤܤǻѤƤ־¡סʿ
ʤɤθˤǯɽꤹ롣glibc 2.2 ʹߤǤΤͭ)
.PP
̤λﹽ¤ \fItm\fP ξܺ٤ \fI<time.h>\fP Ƥ롣
.BR ctime (3)
⻲Ȥ뤳ȡ
.SH ֤
\fBstrftime()\fP ؿʸ \fIs\fP ˳Ǽ줿ʸ֤
ʸ˽ü NUL ʸϴޤޤʤ
ü NUL ʸǼǤ礭äʸϤȡ
ʳξ 0 ֤ʸƤϽʤ
(ϾʤȤ libc 4.4.4 ʹߤǤ˸ŤС libc
㤨 libc 4.4.1 Ǥʸû᤮ˤ \fImax\fP ֤롣)
.LP
֤ 0 ɬ⥨顼̣ƤǤϤʤΤդ뤳ȡ
㤨С¿ΥǤ %p ϶ʸ֤
.SH Ķѿ
Ķѿ TZ  LC_TIME Ѥ롣
(: LC_ALL ꤵƤˤ LC_TIME ⤽餬ͥ褵롣
 LC_TIME  LC_ALL ꤵƤʤˤ LANG Ѥ롣)
.SH 
ANSI C, SVID 3, ISO 9899.
ġѴ̩ˤɤεʤ˴ޤޤ뤫ϡ
ANSI C (ʤ) UNIX  (SU)Olson  timezone ѥå (TZ)
glibc ȼ (GNU) ǼƤ롣glibc2 Ǥ %+ ϥݡȤƤʤ
ĤγĥԤƤ롣POSIX.1 Ǥ ANSI C Τߤ򻲾ȤƤ롣
POSIX.2 
.BR date (1)
ΤȤ˵ҤƤĤγĥ
.B strftime
ˤŬѤǤ
%F Ѵ C99  POSIX 1003.1-2001 ˤ롣
.SH Х
gcc ΤĤΥСˤϤʤȤꡢ
%c λˡˤĤưʲΤ褦ʷٹФ:
.I "warning: `%c' yields only last 2 digits of year in some locales"
.RI ( ٹ: ĤΥǤ `%c' ǯβ2夷Ϥʤ )
ץޤ %c ȤΤϤǤ뤳ȤǤ롣
%c ȤŬڤդȻɽ뤳ȤǤ뤫Ǥ롣
gcc Τ򤷤褦Ȥȡäꤷʤʬˤʤ
Ū줤ʲˡϰʲΤ褦ִؿɲä뤳ȤǤ롣
.RS
size_t my_strftime(char *s, size_t max, const char *fmt,
const struct tm *tm) {
.br
	     return strftime(s, max, fmt, tm);
.br
}
.RE
.SH Ϣ
.BR date (1),
.BR time (2),
.BR ctime (3),
.BR setlocale (3),
.BR sprintf (3),
.BR strptime (3)