Print this page
2964 need POSIX 2008 locale object support
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Approved by: TBD
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3c/strftime.3c
+++ new/usr/src/man/man3c/strftime.3c
1 1 '\" te
2 +.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
2 3 .\" Copyright (c) 2014 Gary Mills
3 4 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
4 5 .\" Copyright 1989 AT&T
5 6 .\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
6 7 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
7 8 .\" http://www.opengroup.org/bookstore/.
8 9 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
9 10 .\" This notice shall appear on any product containing this material.
10 11 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
11 12 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
12 13 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
13 -.TH STRFTIME 3C "Jan 3, 2014"
14 +.TH STRFTIME 3C "Jun 24, 2014"
14 15 .SH NAME
15 -strftime, cftime, ascftime \- convert date and time to string
16 +strftime, strftime_l cftime, ascftime \- convert date and time to string
16 17 .SH SYNOPSIS
17 18 .LP
18 19 .nf
19 20 #include <time.h>
20 21
21 22 \fBsize_t\fR \fBstrftime\fR(\fBchar *restrict\fR \fIs\fR, \fBsize_t\fR \fImaxsize\fR,
22 23 \fBconst char *restrict\fR \fIformat\fR,
23 24 \fBconst struct tm *restrict\fR \fItimeptr\fR);
24 25 .fi
25 -
26 26 .LP
27 27 .nf
28 +\fBsize_t\fR \fBstrftime_l\fR(\fBchar *restrict\fR \fIs\fR, \fBsize_t\fR \fImaxsize\fR,
29 + \fBconst char *restrict\fR \fIformat\fR,
30 + \fBconst struct tm *restrict\fR \fItimeptr\fR, \fBlocale_t\fR \fIloc\fR);
31 +.fi
32 +.LP
33 +.nf
28 34 \fBint\fR \fBcftime\fR(\fBchar *\fR\fIs\fR, \fBchar *\fR\fIformat\fR, \fBconst time_t *\fR\fIclock\fR);
29 35 .fi
30 -
31 36 .LP
32 37 .nf
33 38 \fBint\fR \fBascftime\fR(\fBchar *\fR\fIs\fR, \fBconst char *\fR\fIformat\fR,
34 39 \fBconst struct tm *\fR\fItimeptr\fR);
35 40 .fi
36 41
37 42 .SH DESCRIPTION
38 43 .sp
39 44 .LP
40 -The \fBstrftime()\fR, \fBascftime()\fR, and \fBcftime()\fR functions place
45 +The \fBstrftime()\fR, \fBstrftime_l()\fR, \fBascftime()\fR, and \fBcftime()\fR
46 +functions place
41 47 bytes into the array pointed to by \fIs\fR as controlled by the string pointed
42 48 to by \fIformat\fR. The \fIformat\fR string consists of zero or more conversion
43 49 specifications and ordinary characters. A conversion specification consists of
44 50 a '\fB%\fR' (percent) character and one or two terminating conversion
45 51 characters that determine the conversion specification's behavior. All
46 52 ordinary characters (including the terminating null byte) are copied unchanged
47 53 into the array pointed to by \fIs\fR. If copying takes place between objects
48 54 that overlap, the behavior is undefined. For \fBstrftime()\fR, no more than
49 -\fImaxsize\fR bytes are placed into the array.
50 -.sp
55 +\fImaxsize\fR bytes are placed into the array. The \fBstrftime_l()\fR function
56 +behaves identically to \fBstrftime()\fR function, but instead of operating in
57 +the current locale, it operates in the locale specified by \fIloc\fR.
51 58 .LP
52 59 If \fIformat\fR is \fB(char *)0\fR, then the locale's default format is used.
53 60 For \fBstrftime()\fR the default format is the same as \fB%c\fR; for
54 61 \fBcftime()\fR and \fBascftime()\fR the default format is the same as \fB%+\fR.
55 62 \fBcftime()\fR and \fBascftime()\fR first try to use the value of the
56 63 environment variable \fBCFTIME\fR, and if that is undefined or empty, the
57 64 default format is used.
58 -.sp
59 65 .LP
60 66 Each conversion specification is replaced by appropriate characters as
61 67 described in the following list. The appropriate characters are determined by
62 68 the \fBLC_TIME\fR category of the program's locale and by the values contained
63 69 in the structure pointed to by \fItimeptr\fR for \fBstrftime()\fR and
64 70 \fBascftime()\fR, and by the time represented by \fIclock\fR for
65 71 \fBcftime()\fR.
66 72 .sp
67 73 .ne 2
68 74 .na
69 75 \fB\fB%%\fR\fR
70 76 .ad
71 77 .RS 6n
72 78 Same as \fB%\fR.
73 79 .RE
74 80
75 81 .sp
76 82 .ne 2
77 83 .na
78 84 \fB\fB%a\fR\fR
79 85 .ad
80 86 .RS 6n
81 87 Locale's abbreviated weekday name.
82 88 .RE
83 89
84 90 .sp
85 91 .ne 2
86 92 .na
87 93 \fB\fB%A\fR\fR
88 94 .ad
89 95 .RS 6n
90 96 Locale's full weekday name.
91 97 .RE
92 98
93 99 .sp
94 100 .ne 2
95 101 .na
96 102 \fB\fB%b\fR\fR
97 103 .ad
98 104 .RS 6n
99 105 Locale's abbreviated month name.
100 106 .RE
101 107
102 108 .sp
103 109 .ne 2
104 110 .na
105 111 \fB\fB%B\fR\fR
106 112 .ad
107 113 .RS 6n
108 114 Locale's full month name.
109 115 .RE
110 116
111 117 .sp
112 118 .ne 2
113 119 .na
114 120 \fB\fB%c\fR\fR
115 121 .ad
116 122 .RS 6n
117 123 Locale's appropriate date and time representation.
118 124 In the C locale, this format is:
119 125 .sp
120 126 .in +2
121 127 .nf
122 128 %a %b %e %H:%M:%S %Y
123 129 .fi
124 130 .in -2
125 131 .sp
126 132 Other locales may have different locale-specific formats.
127 133 .RE
128 134
129 135 .sp
130 136 .ne 2
131 137 .na
132 138 \fB\fB%C\fR\fR
133 139 .ad
134 140 .RS 6n
135 141 Century number (the year divided by 100 and truncated to an integer as a
136 142 decimal number [01,99]).
137 143 .RE
138 144
139 145 .sp
140 146 .ne 2
141 147 .na
142 148 \fB\fB%d\fR\fR
143 149 .ad
144 150 .RS 6n
145 151 Day of month [01,31].
146 152 .RE
147 153
148 154 .sp
149 155 .ne 2
150 156 .na
151 157 \fB\fB%D\fR\fR
152 158 .ad
153 159 .RS 6n
154 160 Date as \fB%m\fR/\fB%d\fR/\fB%y\fR.
155 161 .RE
156 162
157 163 .sp
158 164 .ne 2
159 165 .na
160 166 \fB\fB%e\fR\fR
161 167 .ad
162 168 .RS 6n
163 169 Day of month [1,31]; single digits are preceded by a space.
164 170 .RE
165 171
166 172 .sp
167 173 .ne 2
168 174 .na
169 175 \fB\fB%F\fR\fR
170 176 .ad
171 177 .RS 6n
172 178 Equivalent to \fB%Y\fR-\fB%m\fR-\fB%d\fR (the ISO 8601:2000 standard date
173 179 format).
174 180 .RE
175 181
176 182 .sp
177 183 .ne 2
178 184 .na
179 185 \fB\fB%g\fR\fR
180 186 .ad
181 187 .RS 6n
182 188 Week-based year within century [00,99].
183 189 .RE
184 190
185 191 .sp
186 192 .ne 2
187 193 .na
188 194 \fB\fB%G\fR\fR
189 195 .ad
190 196 .RS 6n
191 197 Week-based year, including the century [0000,9999].
192 198 .RE
193 199
194 200 .sp
195 201 .ne 2
196 202 .na
197 203 \fB\fB%h\fR\fR
198 204 .ad
199 205 .RS 6n
200 206 Locale's abbreviated month name.
201 207 .RE
202 208
203 209 .sp
204 210 .ne 2
205 211 .na
206 212 \fB\fB%H\fR\fR
207 213 .ad
208 214 .RS 6n
209 215 Hour (24-hour clock) [00,23].
210 216 .RE
211 217
212 218 .sp
213 219 .ne 2
214 220 .na
215 221 \fB\fB%I\fR\fR
216 222 .ad
217 223 .RS 6n
218 224 Hour (12-hour clock) [01,12].
219 225 .RE
220 226
221 227 .sp
222 228 .ne 2
223 229 .na
224 230 \fB\fB%j\fR\fR
225 231 .ad
226 232 .RS 6n
227 233 Day number of year [001,366].
228 234 .RE
229 235
230 236 .sp
231 237 .ne 2
232 238 .na
233 239 \fB\fB%k\fR\fR
234 240 .ad
235 241 .RS 6n
236 242 Hour (24-hour clock) [0,23]; single digits are preceded by a space.
237 243 .RE
238 244
239 245 .sp
240 246 .ne 2
241 247 .na
242 248 \fB\fB%l\fR\fR
243 249 .ad
244 250 .RS 6n
245 251 Hour (12-hour clock) [1,12]; single digits are preceded by a space.
246 252 .RE
247 253
248 254 .sp
249 255 .ne 2
250 256 .na
251 257 \fB\fB%m\fR\fR
252 258 .ad
253 259 .RS 6n
254 260 Month number [01,12].
255 261 .RE
256 262
257 263 .sp
258 264 .ne 2
259 265 .na
260 266 \fB\fB%M\fR\fR
261 267 .ad
262 268 .RS 6n
263 269 Minute [00,59].
264 270 .RE
265 271
266 272 .sp
267 273 .ne 2
268 274 .na
269 275 \fB\fB%n\fR\fR
270 276 .ad
271 277 .RS 6n
272 278 Insert a NEWLINE.
273 279 .RE
274 280
275 281 .sp
276 282 .ne 2
277 283 .na
278 284 \fB\fB%p\fR\fR
279 285 .ad
280 286 .RS 6n
281 287 Locale's equivalent of either a.m. or p.m.
282 288 .RE
283 289
284 290 .sp
285 291 .ne 2
286 292 .na
287 293 \fB\fB%r\fR\fR
288 294 .ad
289 295 .RS 6n
290 296 Appropriate time representation in 12-hour clock format with \fB%p\fR.
291 297 .RE
292 298
293 299 .sp
294 300 .ne 2
295 301 .na
296 302 \fB\fB%R\fR\fR
297 303 .ad
298 304 .RS 6n
299 305 Time as \fB%H\fR:\fB%M\fR.
300 306 .RE
301 307
302 308 .sp
303 309 .ne 2
304 310 .na
305 311 \fB\fB%s\fR\fR
306 312 .ad
307 313 .RS 6n
308 314 Seconds since 00:00:00 UTC, January 1, 1970.
309 315 .RE
310 316
311 317 .sp
312 318 .ne 2
313 319 .na
314 320 \fB\fB%S\fR\fR
315 321 .ad
316 322 .RS 6n
317 323 Seconds [00,60]; the range of values is [00,60] rather than [00,59] to allow
318 324 for the occasional leap second.
319 325 .RE
320 326
321 327 .sp
322 328 .ne 2
323 329 .na
324 330 \fB\fB%t\fR\fR
325 331 .ad
326 332 .RS 6n
327 333 Insert a TAB.
328 334 .RE
329 335
330 336 .sp
331 337 .ne 2
332 338 .na
333 339 \fB\fB%T\fR\fR
334 340 .ad
335 341 .RS 6n
336 342 Time as \fB%H\fR:\fB%M\fR:\fB%S\fR.
337 343 .RE
338 344
339 345 .sp
340 346 .ne 2
341 347 .na
342 348 \fB\fB%u\fR\fR
343 349 .ad
344 350 .RS 6n
345 351 Weekday as a decimal number [1,7], with 1 representing Monday. See \fBNOTES\fR
346 352 below.
347 353 .RE
348 354
349 355 .sp
350 356 .ne 2
351 357 .na
352 358 \fB\fB%U\fR\fR
353 359 .ad
354 360 .RS 6n
355 361 Week number of year as a decimal number [00,53], with Sunday as the first day
356 362 of week 1.
357 363 .RE
358 364
359 365 .sp
360 366 .ne 2
361 367 .na
362 368 \fB\fB%v\fR\fR
363 369 .ad
364 370 .RS 6n
365 371 Date as \fB%e\fR-\fB%b\fR-\fB%Y\fR.
366 372 .RE
367 373
368 374 .sp
369 375 .ne 2
370 376 .na
371 377 \fB\fB%V\fR\fR
372 378 .ad
373 379 .RS 6n
374 380 The ISO 8601 week number as a decimal number [01,53]. In the ISO 8601
375 381 week-based system, weeks begin on a Monday and week 1 of the year is the week
376 382 that includes both January 4th and the first Thursday of the year. If the
377 383 first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of
378 384 the last week of the preceding year. See \fBNOTES\fR below.
379 385 .RE
380 386
381 387 .sp
382 388 .ne 2
383 389 .na
384 390 \fB\fB%w\fR\fR
385 391 .ad
386 392 .RS 6n
387 393 Weekday as a decimal number [0,6], with 0 representing Sunday.
388 394 .RE
389 395
390 396 .sp
391 397 .ne 2
392 398 .na
393 399 \fB\fB%W\fR\fR
394 400 .ad
395 401 .RS 6n
396 402 Week number of year as a decimal number [00,53], with Monday as the first day
397 403 of week 1.
398 404 .RE
399 405
400 406 .sp
401 407 .ne 2
402 408 .na
403 409 \fB\fB%x\fR\fR
404 410 .ad
405 411 .RS 6n
406 412 Locale's appropriate date representation.
407 413 .RE
408 414
409 415 .sp
410 416 .ne 2
411 417 .na
412 418 \fB\fB%X\fR\fR
413 419 .ad
414 420 .RS 6n
415 421 Locale's appropriate time representation.
416 422 .RE
417 423
418 424 .sp
419 425 .ne 2
420 426 .na
421 427 \fB\fB%y\fR\fR
422 428 .ad
423 429 .RS 6n
424 430 Year within century [00,99].
425 431 .RE
426 432
427 433 .sp
428 434 .ne 2
429 435 .na
430 436 \fB\fB%Y\fR\fR
431 437 .ad
432 438 .RS 6n
433 439 Year, including the century (for example 1993).
434 440 .RE
435 441
436 442 .sp
437 443 .ne 2
438 444 .na
439 445 \fB\fB%z\fR\fR
440 446 .ad
441 447 .RS 6n
442 448 Replaced by offset from UTC in ISO 8601:2000 standard format (\fB+hhmm\fR or
443 449 \fB-hhmm\fR), or by no characters if no time zone is determinable. For example,
444 450 "-0430" means 4 hours 30 minutes behind UTC (west of Greenwich). If
445 451 \fBtm_isdst\fR is zero, the standard time offset is used. If \fBtm_isdst\fR is
446 452 greater than zero, the daylight savings time offset if used. If \fBtm_isdst\fR
447 453 is negative, no characters are returned.
448 454 .RE
449 455
450 456 .sp
451 457 .ne 2
452 458 .na
453 459 \fB\fB%Z\fR\fR
454 460 .ad
455 461 .RS 6n
456 462 Time zone name or abbreviation, or no bytes if no time zone information exists.
457 463 .RE
↓ open down ↓ |
389 lines elided |
↑ open up ↑ |
458 464
459 465 .sp
460 466 .ne 2
461 467 .na
462 468 \fB\fB%+\fR\fR
463 469 .ad
464 470 .RS 6n
465 471 Locale's date and time representation as produced by \fBdate\fR(1).
466 472 .RE
467 473
468 -.sp
469 474 .LP
470 475 If a conversion specification does not correspond to any of the above or to any
471 476 of the modified conversion specifications listed below, the behavior is
472 477 undefined and \fB0\fR is returned.
473 -.sp
474 478 .LP
475 479 The difference between \fB%U\fR and \fB%W\fR (and also between modified
476 480 conversion specifications \fB%OU\fR and \fB%OW\fR) lies in which day is counted
477 481 as the first of the week. Week number 1 is the first week in January starting
478 482 with a Sunday for \fB%U\fR or a Monday for \fB%W\fR. Week number 0 contains
479 483 those days before the first Sunday or Monday in January for \fB%U\fR and
480 484 \fB%W\fR, respectively.
481 485 .SS "Modified Conversion Specifications"
482 -.sp
483 486 .LP
484 487 Some conversion specifications can be modified by the \fBE\fR and \fBO\fR
485 488 modifiers to indicate that an alternate format or specification should be used
486 489 rather than the one normally used by the unmodified conversion specification.
487 490 If the alternate format or specification does not exist in the current locale,
488 491 the behavior will be as if the unmodified specification were used.
489 492 .sp
490 493 .ne 2
491 494 .na
492 495 \fB\fB%Ec\fR\fR
493 496 .ad
494 497 .RS 7n
495 498 Locale's alternate appropriate date and time representation.
496 499 .RE
497 500
498 501 .sp
499 502 .ne 2
500 503 .na
501 504 \fB\fB%EC\fR\fR
502 505 .ad
503 506 .RS 7n
504 507 Name of the base year (period) in the locale's alternate representation.
505 508 .RE
506 509
507 510 .sp
508 511 .ne 2
509 512 .na
510 513 \fB\fB%Eg\fR\fR
511 514 .ad
512 515 .RS 7n
513 516 Offset from \fB%EC\fR of the week-based year in the locale's alternative
514 517 representation.
515 518 .RE
516 519
517 520 .sp
518 521 .ne 2
519 522 .na
520 523 \fB\fB%EG\fR\fR
521 524 .ad
522 525 .RS 7n
523 526 Full alternative representation of the week-based year.
524 527 .RE
525 528
526 529 .sp
527 530 .ne 2
528 531 .na
529 532 \fB\fB%Ex\fR\fR
530 533 .ad
531 534 .RS 7n
532 535 Locale's alternate date representation.
533 536 .RE
534 537
535 538 .sp
536 539 .ne 2
537 540 .na
538 541 \fB\fB%EX\fR\fR
539 542 .ad
540 543 .RS 7n
541 544 Locale's alternate time representation.
542 545 .RE
543 546
544 547 .sp
545 548 .ne 2
546 549 .na
547 550 \fB\fB%Ey\fR\fR
548 551 .ad
549 552 .RS 7n
550 553 Offset from \fB%EC\fR (year only) in the locale's alternate representation.
551 554 .RE
552 555
553 556 .sp
554 557 .ne 2
555 558 .na
556 559 \fB\fB%EY\fR\fR
557 560 .ad
558 561 .RS 7n
559 562 Full alternate year representation.
560 563 .RE
561 564
562 565 .sp
563 566 .ne 2
564 567 .na
565 568 \fB\fB%Od\fR\fR
566 569 .ad
567 570 .RS 7n
568 571 Day of the month using the locale's alternate numeric symbols.
569 572 .RE
570 573
571 574 .sp
572 575 .ne 2
573 576 .na
574 577 \fB\fB%Oe\fR\fR
575 578 .ad
576 579 .RS 7n
577 580 Same as \fB%Od\fR.
578 581 .RE
579 582
580 583 .sp
581 584 .ne 2
582 585 .na
583 586 \fB\fB%Og\fR\fR
584 587 .ad
585 588 .RS 7n
586 589 Week-based year (offset from \fB%C\fR) in the locale's alternate representation
587 590 and using the locale's alternate numeric symbols.
588 591 .RE
589 592
590 593 .sp
591 594 .ne 2
592 595 .na
593 596 \fB\fB%OH\fR\fR
594 597 .ad
595 598 .RS 7n
596 599 Hour (24-hour clock) using the locale's alternate numeric symbols.
597 600 .RE
598 601
599 602 .sp
600 603 .ne 2
601 604 .na
602 605 \fB\fB%OI\fR\fR
603 606 .ad
604 607 .RS 7n
605 608 Hour (12-hour clock) using the locale's alternate numeric symbols.
606 609 .RE
607 610
608 611 .sp
609 612 .ne 2
610 613 .na
611 614 \fB\fB%Om\fR\fR
612 615 .ad
613 616 .RS 7n
614 617 Month using the locale's alternate numeric symbols.
615 618 .RE
616 619
617 620 .sp
618 621 .ne 2
619 622 .na
620 623 \fB\fB%OM\fR\fR
621 624 .ad
622 625 .RS 7n
623 626 Minutes using the locale's alternate numeric symbols.
624 627 .RE
625 628
626 629 .sp
627 630 .ne 2
628 631 .na
629 632 \fB\fB%OS\fR\fR
630 633 .ad
631 634 .RS 7n
632 635 Seconds using the locale's alternate numeric symbols.
633 636 .RE
634 637
635 638 .sp
636 639 .ne 2
637 640 .na
638 641 \fB\fB%Ou\fR\fR
639 642 .ad
640 643 .RS 7n
641 644 Weekday as a number in the locale's alternate numeric symbols.
642 645 .RE
643 646
644 647 .sp
645 648 .ne 2
646 649 .na
647 650 \fB\fB%OU\fR\fR
648 651 .ad
649 652 .RS 7n
650 653 Week number of the year (Sunday as the first day of the week) using the
651 654 locale's alternate numeric symbols.
652 655 .RE
653 656
654 657 .sp
655 658 .ne 2
656 659 .na
657 660 \fB\fB%Ow\fR\fR
658 661 .ad
659 662 .RS 7n
660 663 Number of the weekday (Sunday=0) using the locale's alternate numeric symbols.
661 664 .RE
662 665
663 666 .sp
664 667 .ne 2
665 668 .na
666 669 \fB\fB%OW\fR\fR
667 670 .ad
668 671 .RS 7n
669 672 Week number of the year (Monday as the first day of the week) using the
670 673 locale's alternate numeric symbols.
671 674 .RE
672 675
673 676 .sp
↓ open down ↓ |
181 lines elided |
↑ open up ↑ |
674 677 .ne 2
675 678 .na
676 679 \fB\fB%Oy\fR\fR
677 680 .ad
678 681 .RS 7n
679 682 Year (offset from \fB%C\fR) in the locale's alternate representation and using
680 683 the locale's alternate numeric symbols.
681 684 .RE
682 685
683 686 .SS "Selecting the Output Language"
684 -.sp
685 687 .LP
686 -By default, the output of \fBstrftime()\fR, \fBcftime()\fR, and
687 -\fBascftime()\fR appear in U.S. English. The user can request that the output
688 -of \fBstrftime()\fR, \fBcftime()\fR, or \fBascftime()\fR be in a specific
689 -language by setting the \fBLC_TIME\fR category using \fBsetlocale()\fR.
688 +These routines produce output that is formatted according to the \fBLC_TIME\fR
689 +locale category. They use either the current locale, or in the case of
690 +\fBstrftime_l()\fR, the locale supplied by \fIloc\fR.
690 691 .SS "Time Zone"
691 -.sp
692 692 .LP
693 693 Local time zone information is used as though \fBtzset\fR(3C) were called.
694 694 .SH RETURN VALUES
695 -.sp
696 695 .LP
697 -The \fBstrftime()\fR, \fBcftime()\fR, and \fBascftime()\fR functions return the
696 +These functions return the
698 697 number of characters placed into the array pointed to by \fIs\fR, not including
699 698 the terminating null character. If the total number of resulting characters
700 699 including the terminating null character is more than \fImaxsize\fR,
701 700 \fBstrftime()\fR returns \fB0\fR and the contents of the array are
702 701 indeterminate.
703 702 .SH EXAMPLES
704 703 .LP
705 704 \fBExample 1 \fRAn example of the \fBstrftime()\fR function.
706 -.sp
707 705 .LP
708 706 The following example illustrates the use of \fBstrftime()\fR for the
709 707 \fBPOSIX\fR locale. It shows what the string in \fIstr\fR would look like if
710 708 the structure pointed to by \fItmptr\fR contains the values corresponding to
711 709 Thursday, August 28, 1986 at 12:44:36.
712 -
713 -.sp
714 -.in +2
715 710 .nf
716 -\fBstrftime (str, strsize, "%A %b %d %j", tmptr)\fR
711 +.IP
712 +\fBstrftime\fR(\fIstr\fR, \fIstrsize\fR, "%A %b %d %j", \fItmptr\fR);
717 713 .fi
718 -.in -2
719 -
720 -.sp
721 714 .LP
722 715 This results in \fIstr\fR containing "Thursday Aug 28 240".
723 -
724 716 .SH ATTRIBUTES
725 -.sp
726 717 .LP
727 718 See \fBattributes\fR(5) for descriptions of the following attributes:
728 -.sp
729 -
730 -.sp
731 719 .TS
732 720 box;
733 721 c | c
734 722 l | l .
735 723 ATTRIBUTE TYPE ATTRIBUTE VALUE
736 724 _
737 725 CSI Enabled
738 726 _
739 -Interface Stability Committed
727 +Interface Stability See below.
740 728 _
741 729 MT-Level MT-Safe
742 730 _
743 731 Standard See below.
744 732 .TE
745 733
746 -.sp
747 734 .LP
748 -For \fBstrftime()\fR, see \fBstandards\fR(5).
735 +The \fBstrftime()\fR and \fBstrftime_l()\fR functions are Standard.
736 +\fBcftime()\fR and \fBascftime()\fR functions are Committed.
737 +.LP
738 +For \fBstrftime()\fR and \fBstrftime_l()\fR, see \fBstandards\fR(5).
749 739 .SH SEE ALSO
750 -.sp
751 740 .LP
752 -\fBdate\fR(1), \fBctime\fR(3C), \fBmktime\fR(3C), \fBsetlocale\fR(3C),
753 -\fBstrptime\fR(3C), \fBtzset\fR(3C), \fBTIMEZONE\fR(4), \fBzoneinfo\fR(4),
741 +\fBdate\fR(1), \fBctime\fR(3C), \fBmktime\fR(3C),
742 +\fBnewlocale\fR(3C), \fBsetlocale\fR(3C), \fBstrptime\fR(3C), \fBtzset\fR(3C),
743 +\fBuselocale\fR(3C), \fBTIMEZONE\fR(4), \fBzoneinfo\fR(4),
754 744 \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)
755 745 .SH NOTES
756 -.sp
757 746 .LP
758 747 The conversion specification for \fB%V\fR was changed in the Solaris 7 release.
759 748 This change was based on the public review draft of the ISO C9x standard at
760 749 that time. Previously, the specification stated that if the week containing 1
761 750 January had fewer than four days in the new year, it became week 53 of the
762 751 previous year. The ISO C9x standard committee subsequently recognized that that
763 752 specification had been incorrect.
764 -.sp
765 753 .LP
766 754 The conversion specifications for \fB%g\fR, \fB%G\fR, \fB%Eg\fR, \fB%EG\fR, and
767 755 \fB%Og\fR were added in the Solaris 7 release. This change was based on the
768 -public review draft of the ISO C9x standard at that time. These specifications
769 -are evolving. If the ISO C9x standard is finalized with a different
770 -conclusion, these specifications will change to conform to the ISO C9x standard
771 -decision.
772 -.sp
756 +public review draft of the ISO C9x standard at that time. The \fB%g\fR and
757 +\fB%G\fR specifications were adopted in the formal standard. The other two
758 +were not, and should not be used in portable applications.
773 759 .LP
774 760 The conversion specification for \fB%u\fR was changed in the Solaris 8 release.
775 761 This change was based on the XPG4 specification.
776 -.sp
777 762 .LP
778 763 If using the \fB%Z\fR specifier and \fBzoneinfo\fR timezones and if the input
779 764 date is outside the range 20:45:52 UTC, December 13, 1901 to 03:14:07 UTC,
780 765 January 19, 2038, the timezone name may not be correct.
781 -.sp
782 766 .LP
783 767 The conversion specification for \fB%+\fR was added in illumos.
784 768 It is not part of any standard, although it is available on a number
785 769 of other platforms.
786 770 Its use is discouraged for conforming applications.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX