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/strptime.3c
+++ new/usr/src/man/man3c/strptime.3c
1 1 '\" te
2 +.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
2 3 .\" Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
3 4 .\" Portions Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
4 5 .\" 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
5 6 .\" http://www.opengroup.org/bookstore/.
6 7 .\" 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.
7 8 .\" This notice shall appear on any product containing this material.
8 9 .\" 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.
9 10 .\" 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.
10 11 .\" 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]
11 -.TH STRPTIME 3C "Aug 27, 2007"
12 +.TH STRPTIME 3C "Jun 27, 2014"
12 13 .SH NAME
13 -strptime \- date and time conversion
14 +strptime, strptime_l \- date and time conversion
14 15 .SH SYNOPSIS
15 16 .LP
16 17 .nf
17 18 #include <time.h>
18 19
19 20 \fBchar *\fR\fBstrptime\fR(\fBconst char *restrict\fR \fIbuf\fR,
20 21 \fBconst char *restrict\fR \fIformat\fR, \fBstruct tm *restrict\fR \fItm\fR);
21 22 .fi
23 +.LP
24 +.nf
25 +#include <time.h>
26 +#include <xlocale.h>
22 27
28 +\fBchar *\fR\fBstrptime_l\fR(\fBconst char *restrict\fR \fIbuf\fR,
29 + \fBconst char *restrict\fR \fIformat\fR, \fBstruct tm *restrict\fR \fItm\fR,
30 + \fBlocale_t\fR \fIloc\fR);
31 +.fi
23 32 .SS "Non-zeroing Behavior"
24 33 .LP
25 34 .nf
26 35 \fBcc\fR [\fIflag\fR...] \fIfile\fR... \fB-D_STRPTIME_DONTZERO\fR [\fIlibrary\fR...]
27 36 #include <time.h>
28 37
29 38 \fBchar *\fR\fBstrptime\fR(\fBconst char *restrict\fR \fIbuf\fR,
30 39 \fBconst char *restrict\fR \fIformat\fR, \fBstruct tm *restrict\fR \fItm\fR);
31 40 .fi
32 41
33 42 .SH DESCRIPTION
34 -.sp
35 43 .LP
36 44 The \fBstrptime()\fR function converts the character string pointed to by
37 45 \fIbuf\fR to values which are stored in the \fBtm\fR structure pointed to by
38 -\fItm\fR, using the format specified by \fIformat\fR.
39 -.sp
46 +\fItm\fR, using the format specified by \fIformat\fR. The \fBstrptime_l()\fR
47 +function is identical to \fBstrptime()\fR except instead of acting in the
48 +current locale, it acts in the locale specified by the argument \fIloc\fR.
40 49 .LP
41 50 The \fIformat\fR argument is composed of zero or more conversion
42 51 specifications. Each conversion specification is composed of a "%" (percent)
43 52 character followed by one or two conversion characters which specify the
44 53 replacement required. One or more white space characters (as specified by
45 54 \fBisspace\fR(3C)) may precede or follow a conversion specification. There must
46 55 be white-space or other non-alphanumeric characters between any two conversion
47 56 specifications.
48 -.sp
49 57 .LP
50 58 A non-zeroing version of \fBstrptime()\fR, described below under \fBNon-zeroing
51 59 Behavior\fR, is provided if \fB_STRPTIME_DONTZERO\fR is defined.
52 60 .SS "Conversion Specifications"
53 -.sp
54 61 .LP
55 62 The following conversion specifications are supported:
56 63 .sp
57 64 .ne 2
58 65 .na
59 66 \fB\fB%%\fR\fR
60 67 .ad
61 68 .RS 6n
62 69 Same as \fB%\fR.
63 70 .RE
64 71
65 72 .sp
66 73 .ne 2
67 74 .na
68 75 \fB\fB%a\fR\fR
69 76 .ad
70 77 .RS 6n
71 78 Day of week, using the locale's weekday names; either the abbreviated or full
72 79 name may be specified.
73 80 .RE
74 81
75 82 .sp
76 83 .ne 2
77 84 .na
78 85 \fB\fB%A\fR\fR
79 86 .ad
80 87 .RS 6n
81 88 Same as \fB%a\fR.
82 89 .RE
83 90
84 91 .sp
85 92 .ne 2
86 93 .na
87 94 \fB\fB%b\fR\fR
88 95 .ad
89 96 .RS 6n
90 97 Month, using the locale's month names; either the abbreviated or full name may
91 98 be specified.
92 99 .RE
93 100
94 101 .sp
95 102 .ne 2
96 103 .na
97 104 \fB\fB%B\fR\fR
98 105 .ad
99 106 .RS 6n
100 107 Same as \fB%b\fR.
101 108 .RE
102 109
103 110 .sp
104 111 .ne 2
105 112 .na
106 113 \fB\fB%c\fR\fR
107 114 .ad
108 115 .RS 6n
109 116 Locale's appropriate date and time representation.
110 117 .RE
111 118
112 119 .sp
113 120 .ne 2
114 121 .na
115 122 \fB\fB%C\fR\fR
116 123 .ad
117 124 .RS 6n
118 125 Century number (the year divided by 100 and truncated to an integer as a
119 126 decimal number [1,99]); single digits are preceded by 0. If \fB%C\fR is used
120 127 without the \fB%y\fR specifier, \fBstrptime()\fR assumes the year offset is
121 128 zero in whichever century is specified. Note the behavior of \fB%C\fR in the
122 129 absence of \fB%y\fR is not specified by any of the standards or specifications
123 130 described on the \fBstandards\fR(5) manual page, so portable applications
124 131 should not depend on it. This behavior may change in a future release.
125 132 .RE
126 133
127 134 .sp
128 135 .ne 2
129 136 .na
130 137 \fB\fB%d\fR\fR
131 138 .ad
132 139 .RS 6n
133 140 Day of month [1,31]; leading zero is permitted but not required.
134 141 .RE
135 142
136 143 .sp
137 144 .ne 2
138 145 .na
139 146 \fB\fB%D\fR\fR
140 147 .ad
141 148 .RS 6n
142 149 Date as \fB%m\fR/\fB%d\fR/\fB%y\fR.
143 150 .RE
144 151
145 152 .sp
146 153 .ne 2
147 154 .na
148 155 \fB\fB%e\fR\fR
149 156 .ad
150 157 .RS 6n
151 158 Same as \fB%d\fR.
152 159 .RE
153 160
154 161 .sp
155 162 .ne 2
156 163 .na
157 164 \fB\fB%h\fR\fR
158 165 .ad
159 166 .RS 6n
160 167 Same as \fB%b\fR.
161 168 .RE
162 169
163 170 .sp
164 171 .ne 2
165 172 .na
166 173 \fB\fB%H\fR\fR
167 174 .ad
168 175 .RS 6n
169 176 Hour (24-hour clock) [0,23]; leading zero is permitted but not required.
170 177 .RE
171 178
172 179 .sp
173 180 .ne 2
174 181 .na
175 182 \fB\fB%I\fR\fR
176 183 .ad
177 184 .RS 6n
178 185 Hour (12-hour clock) [1,12]; leading zero is permitted but not required.
179 186 .RE
180 187
181 188 .sp
182 189 .ne 2
183 190 .na
184 191 \fB\fB%j\fR\fR
185 192 .ad
186 193 .RS 6n
187 194 Day number of the year [1,366]; leading zeros are permitted but not required.
188 195 .RE
189 196
190 197 .sp
191 198 .ne 2
192 199 .na
193 200 \fB\fB%m\fR\fR
194 201 .ad
195 202 .RS 6n
196 203 Month number [1,12]; leading zero is permitted but not required.
197 204 .RE
198 205
199 206 .sp
200 207 .ne 2
201 208 .na
202 209 \fB\fB%M\fR\fR
203 210 .ad
204 211 .RS 6n
205 212 Minute [0-59]; leading zero is permitted but not required.
206 213 .RE
207 214
208 215 .sp
209 216 .ne 2
210 217 .na
211 218 \fB\fB%n\fR\fR
212 219 .ad
213 220 .RS 6n
214 221 Any white space.
215 222 .RE
216 223
217 224 .sp
218 225 .ne 2
219 226 .na
220 227 \fB\fB%p\fR\fR
221 228 .ad
222 229 .RS 6n
223 230 Locale's equivalent of either a.m. or p.m.
224 231 .RE
225 232
226 233 .sp
227 234 .ne 2
228 235 .na
229 236 \fB\fB%r\fR\fR
230 237 .ad
231 238 .RS 6n
232 239 Appropriate time representation in the 12-hour clock format with \fB%p\fR.
233 240 .RE
234 241
235 242 .sp
236 243 .ne 2
237 244 .na
238 245 \fB\fB%R\fR\fR
239 246 .ad
240 247 .RS 6n
241 248 Time as \fB%H\fR:\fB%M\fR.
242 249 .RE
243 250
244 251 .SS "SUSv3"
245 252 .sp
246 253 .ne 2
247 254 .na
248 255 \fB\fB%S\fR\fR
249 256 .ad
250 257 .RS 6n
251 258 Seconds [0,60]; leading zero is permitted but not required. The range of values
252 259 is [00,60] rather than [00,59] to allow for the occasional leap second.
253 260 .RE
254 261
255 262 .SS "Default and other standards"
256 263 .sp
257 264 .ne 2
258 265 .na
259 266 \fB\fB%S\fR\fR
260 267 .ad
261 268 .RS 6n
262 269 Seconds [0,61]; leading zero is permitted but not required. The range of values
263 270 is [00,61] rather than [00,59] to allow for the occasional leap second and even
264 271 more occasional double leap second.
265 272 .RE
266 273
267 274 .sp
268 275 .ne 2
269 276 .na
270 277 \fB\fB%t\fR\fR
271 278 .ad
272 279 .RS 6n
273 280 Any white space.
274 281 .RE
275 282
276 283 .sp
277 284 .ne 2
278 285 .na
279 286 \fB\fB%T\fR\fR
280 287 .ad
281 288 .RS 6n
282 289 Time as \fB%H\fR:\fB%M\fR:\fB%S\fR.
283 290 .RE
284 291
285 292 .sp
286 293 .ne 2
287 294 .na
288 295 \fB\fB%U\fR\fR
289 296 .ad
290 297 .RS 6n
291 298 Week number of the year as a decimal number [0,53], with Sunday as the first
292 299 day of the week; leading zero is permitted but not required.
293 300 .RE
294 301
295 302 .sp
296 303 .ne 2
297 304 .na
298 305 \fB\fB%w\fR\fR
299 306 .ad
300 307 .RS 6n
301 308 Weekday as a decimal number [0,6], with 0 representing Sunday.
302 309 .RE
303 310
304 311 .sp
305 312 .ne 2
306 313 .na
307 314 \fB\fB%W\fR\fR
308 315 .ad
309 316 .RS 6n
310 317 Week number of the year as a decimal number [0,53], with Monday as the first
311 318 day of the week; leading zero is permitted but not required.
312 319 .RE
313 320
314 321 .sp
315 322 .ne 2
316 323 .na
317 324 \fB\fB%x\fR\fR
318 325 .ad
319 326 .RS 6n
320 327 Locale's appropriate date representation.
321 328 .RE
322 329
323 330 .sp
324 331 .ne 2
325 332 .na
326 333 \fB\fB%X\fR\fR
327 334 .ad
328 335 .RS 6n
329 336 Locale's appropriate time representation.
330 337 .RE
331 338
332 339 .sp
333 340 .ne 2
334 341 .na
335 342 \fB\fB%y\fR\fR
336 343 .ad
337 344 .RS 6n
338 345 Year within century. When a century is not otherwise specified, values in the
339 346 range 69-99 refer to years in the twentieth century (1969 to 1999 inclusive);
340 347 values in the range 00-68 refer to years in the twenty-first century (2000 to
341 348 2068 inclusive).
342 349 .RE
343 350
344 351 .sp
345 352 .ne 2
346 353 .na
347 354 \fB\fB%Y\fR\fR
348 355 .ad
349 356 .RS 6n
350 357 Year, including the century (for example, 1993).
351 358 .RE
352 359
↓ open down ↓ |
289 lines elided |
↑ open up ↑ |
353 360 .sp
354 361 .ne 2
355 362 .na
356 363 \fB\fB%Z\fR\fR
357 364 .ad
358 365 .RS 6n
359 366 Time zone name or no characters if no time zone exists.
360 367 .RE
361 368
362 369 .SS "Modified Conversion Specifications"
363 -.sp
364 370 .LP
365 371 Some conversion specifications can be modified by the \fBE\fR and \fBO\fR
366 372 modifier characters to indicate that an alternate format or specification
367 373 should be used rather than the one normally used by the unmodified
368 374 specification. If the alternate format or specification does not exist in the
369 375 current locale, the behavior will be as if the unmodified conversion
370 376 specification were used.
371 377 .sp
372 378 .ne 2
373 379 .na
374 380 \fB\fB%Ec\fR\fR
375 381 .ad
376 382 .RS 7n
377 383 Locale's alternate appropriate date and time representation.
378 384 .RE
379 385
380 386 .sp
381 387 .ne 2
382 388 .na
383 389 \fB\fB%EC\fR\fR
384 390 .ad
385 391 .RS 7n
386 392 Name of the base year (era) in the locale's alternate representation.
387 393 .RE
388 394
389 395 .sp
390 396 .ne 2
391 397 .na
392 398 \fB\fB%Ex\fR\fR
393 399 .ad
394 400 .RS 7n
395 401 Locale's alternate date representation.
396 402 .RE
397 403
398 404 .sp
399 405 .ne 2
400 406 .na
401 407 \fB\fB%EX\fR\fR
402 408 .ad
403 409 .RS 7n
404 410 Locale's alternate time representation.
405 411 .RE
406 412
407 413 .sp
408 414 .ne 2
409 415 .na
410 416 \fB\fB%Ey\fR\fR
411 417 .ad
412 418 .RS 7n
413 419 Offset from \fB%EC\fR (year only) in the locale's alternate representation.
414 420 .RE
415 421
416 422 .sp
417 423 .ne 2
418 424 .na
419 425 \fB\fB%EY\fR\fR
420 426 .ad
421 427 .RS 7n
422 428 Full alternate year representation.
423 429 .RE
424 430
425 431 .sp
426 432 .ne 2
427 433 .na
428 434 \fB\fB%Od\fR\fR
429 435 .ad
430 436 .RS 7n
431 437 Day of the month using the locale's alternate numeric symbols.
432 438 .RE
433 439
434 440 .sp
435 441 .ne 2
436 442 .na
437 443 \fB\fB%Oe\fR\fR
438 444 .ad
439 445 .RS 7n
440 446 Same as \fB%Od\fR.
441 447 .RE
442 448
443 449 .sp
444 450 .ne 2
445 451 .na
446 452 \fB\fB%OH\fR\fR
447 453 .ad
448 454 .RS 7n
449 455 Hour (24-hour clock) using the locale's alternate numeric symbols.
450 456 .RE
451 457
452 458 .sp
453 459 .ne 2
454 460 .na
455 461 \fB\fB%OI\fR\fR
456 462 .ad
457 463 .RS 7n
458 464 Hour (12-hour clock) using the locale's alternate numeric symbols.
459 465 .RE
460 466
461 467 .sp
462 468 .ne 2
463 469 .na
464 470 \fB\fB%Om\fR\fR
465 471 .ad
466 472 .RS 7n
467 473 Month using the locale's alternate numeric symbols.
468 474 .RE
469 475
470 476 .sp
471 477 .ne 2
472 478 .na
473 479 \fB\fB%OM\fR\fR
474 480 .ad
475 481 .RS 7n
476 482 Minutes using the locale's alternate numeric symbols.
477 483 .RE
478 484
479 485 .sp
480 486 .ne 2
481 487 .na
482 488 \fB\fB%OS\fR\fR
483 489 .ad
484 490 .RS 7n
485 491 Seconds using the locale's alternate numeric symbols.
486 492 .RE
487 493
488 494 .sp
489 495 .ne 2
490 496 .na
491 497 \fB\fB%OU\fR\fR
492 498 .ad
493 499 .RS 7n
494 500 Week number of the year (Sunday as the first day of the week) using the
495 501 locale's alternate numeric symbols.
496 502 .RE
497 503
498 504 .sp
499 505 .ne 2
500 506 .na
501 507 \fB\fB%Ow\fR\fR
502 508 .ad
503 509 .RS 7n
504 510 Number of the weekday (Sunday=0) using the locale's alternate numeric symbols.
505 511 .RE
506 512
507 513 .sp
508 514 .ne 2
509 515 .na
510 516 \fB\fB%OW\fR\fR
511 517 .ad
512 518 .RS 7n
513 519 Week number of the year (Monday as the first day of the week) using the
514 520 locale's alternate numeric symbols.
515 521 .RE
516 522
517 523 .sp
↓ open down ↓ |
144 lines elided |
↑ open up ↑ |
518 524 .ne 2
519 525 .na
520 526 \fB\fB%Oy\fR\fR
521 527 .ad
522 528 .RS 7n
523 529 Year (offset from \fB%C\fR) in the locale's alternate representation and using
524 530 the locale's alternate numeric symbols.
525 531 .RE
526 532
527 533 .SS "General Specifications"
528 -.sp
529 534 .LP
530 535 A conversion specification that is an ordinary character is executed by
531 536 scanning the next character from the buffer. If the character scanned from the
532 537 buffer differs from the one comprising the specification, the specification
533 538 fails, and the differing and subsequent characters remain unscanned.
534 539 .sp
535 540 .LP
536 541 A series of specifications composed of \fB%n\fR, \fB%t\fR, white-space
537 542 characters or any combination is executed by scanning up to the first character
538 543 that is not white space (which remains unscanned), or until no more characters
539 544 can be scanned. White space is defined by \fBisspace\fR(3C).
540 -.sp
541 545 .LP
542 546 Any other conversion specification is executed by scanning characters until a
543 547 character matching the next specification is scanned, or until no more
544 548 characters can be scanned. These characters, except the one matching the next
545 549 specification, are then compared to the locale values associated with the
546 550 conversion specifier. If a match is found, values for the appropriate
547 551 \fItm\fR structure members are set to values corresponding to the locale
548 552 information. If no match is found, \fBstrptime()\fR fails and no more
549 553 characters are scanned.
550 554 .sp
551 555 .LP
552 556 The month names, weekday names, era names, and alternate numeric symbols can
553 557 consist of any combination of upper and lower case letters. The user can
554 558 request that the input date or time specification be in a specific language by
555 559 setting the \fBLC_TIME\fR category using \fBsetlocale\fR(3C).
556 560 .SS "Non-zeroing Behavior"
557 -.sp
558 561 .LP
559 562 In addition to the behavior described above by various standards, the Solaris
560 563 implementation of \fBstrptime()\fR provides the following extensions. These may
561 564 change at any time in the future. Portable applications should not depend on
562 565 these extended features:
563 566 .RS +4
564 567 .TP
565 568 .ie t \(bu
566 569 .el o
567 570 If \fB_STRPTIME_DONTZERO\fR is not defined, the \fBtm struct\fR is zeroed on
568 571 entry and \fBstrptime()\fR updates the fields of the \fBtm struct\fR associated
569 572 with the specifiers in the format string.
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
570 573 .RE
571 574 .RS +4
572 575 .TP
573 576 .ie t \(bu
574 577 .el o
575 578 If \fB_STRPTIME_DONTZERO\fR is defined, \fBstrptime()\fR does not zero the
576 579 \fBtm struct\fR on entry. Additionally, for some specifiers, \fBstrptime()\fR
577 580 will use some values in the input \fBtm struct\fR to recalculate the date and
578 581 re-assign the appropriate members of the \fBtm struct\fR.
579 582 .RE
580 -.sp
581 583 .LP
582 584 The following describes extended features regardless of whether
583 585 \fB_STRPTIME_DONTZERO\fR is defined or not defined:
584 586 .RS +4
585 587 .TP
586 588 .ie t \(bu
587 589 .el o
588 590 If \fB%j\fR is specified, \fBtm_yday\fR is set; if year is given, and if month
589 591 and day are not given, \fBstrptime()\fR calculates and sets \fBtm_mon\fR,
590 592 \fBtm_mday\fR, and \fBtm_year\fR.
591 593 .RE
592 594 .RS +4
593 595 .TP
594 596 .ie t \(bu
595 597 .el o
596 598 If \fB%U\fR or \fB%W\fR is specified and if weekday and year are given and
597 599 month and day of month are not given, \fBstrptime()\fR calculates and sets
598 600 \fBtm_mon\fR, \fBtm_mday\fR, \fBtm_wday\fR, and \fBtm_year\fR.
599 601 .RE
600 -.sp
601 602 .LP
602 603 The following describes extended features when \fB_STRPTIME_DONTZERO\fR is not
603 604 defined:
604 605 .RS +4
605 606 .TP
606 607 .ie t \(bu
607 608 .el o
608 609 If \fB%C\fR is specified and \fB%y\fR is not specified, \fBstrptime()\fRassumes
609 610 0 as the year offset, then calculates the year, and assigns \fBtm_year\fR.
610 611 .RE
611 -.sp
612 612 .LP
613 613 The following describes extended features when \fB_STRPTIME_DONTZERO\fR is
614 614 defined:
615 615 .RS +4
616 616 .TP
617 617 .ie t \(bu
618 618 .el o
619 619 If \fB%C\fR is specified and \fB%y\fR is not specified, \fBstrptime()\fR
620 620 assumes the year offset of the year value of the \fBtm_year\fR member of the
621 621 input \fBtm struct\fR, then calculates the year and assigns \fBtm_year\fR.
622 622 .RE
623 623 .RS +4
624 624 .TP
625 625 .ie t \(bu
626 626 .el o
627 627 If \fB%j\fR is specified and neither \fB%y\fR, \fB%Y\fR, nor \fB%C\fR are
628 628 specified, and neither month nor day of month are specified, \fBstrptime()\fR
629 629 assumes the year value given by the value of the \fBtm_year\fR field of the
630 630 input \fBtm struct\fR. Then, in addition to setting \fBtm_yday\fR,
631 631 \fBstrptime()\fR uses day-of-year and year values to calculate the month and
632 632 day-of-month, and assigns \fBtm_month\fR and \fBtm_mday\fR.
633 633 .RE
634 634 .RS +4
635 635 .TP
636 636 .ie t \(bu
637 637 .el o
638 638 If \fB%U\fR or \fB%W\fR is specified, and if weekday and/or year are not given,
639 639 and month and day of month are not given, \fBstrptime()\fR will assume the
640 640 weekday value and/or the year value as the value of the \fBtm_wday\fR field
641 641 and/or \fBtm_year\fR field of the input \fBtm struct\fR. Then,
642 642 \fBstrptime()\fR will calculate the month and day-of-month and assign
643 643 \fBtm_month\fR, \fBtm_mday\fR, and/or \fBtm_year\fR.
644 644 .RE
645 645 .RS +4
646 646 .TP
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
647 647 .ie t \(bu
648 648 .el o
649 649 If \fB%p\fR is specified and if hour is not specified, \fBstrptime()\fR will
650 650 reference, and if needed, update the \fBtm_hour\fR member. If the \fBam_pm\fR
651 651 input is p.m. and the input \fBtm_hour\fR value is between 0 - 11,
652 652 \fBstrptime()\fR will add 12 hours and update \fBtm_hour\fR. If the
653 653 \fBam_pm\fR input is a.m. and input \fBtm_hour\fR value is between 12 - 23,
654 654 \fBstrptime()\fR will subtract 12 hours and update \fBtm_hour\fR.
655 655 .RE
656 656 .SH RETURN VALUES
657 -.sp
658 657 .LP
659 658 Upon successful completion, \fBstrptime()\fR returns a pointer to the character
660 659 following the last character parsed. Otherwise, a null pointer is returned.
661 660 .SH USAGE
662 -.sp
663 661 .LP
664 662 Several "same as" formats, and the special processing of white-space characters
665 663 are provided in order to ease the use of identical \fIformat\fR strings for
666 664 \fBstrftime\fR(3C) and \fBstrptime()\fR.
667 -.sp
668 665 .LP
669 666 The \fBstrptime()\fR function tries to calculate \fBtm_year\fR, \fBtm_mon\fR,
670 667 and \fBtm_mday\fR when given incomplete input. This allows the \fBstruct tm\fR
671 668 created by \fBstrptime()\fR to be passed to \fBmktime\fR(3C) to produce a
672 669 \fBtime_t\fR value for dates and times that are representable by a
673 670 \fBtime_t\fR. As an example, since \fBmktime()\fR ignores \fBtm_yday\fR,
674 671 \fBstrptime()\fR calculates \fBtm_mon\fR and \fBtm_mday\fR as well as filling
675 672 in \fBtm_yday\fR when \fB%j\fR is specified without otherwise specifying a
676 673 month and day within month.
677 674 .SH ATTRIBUTES
678 -.sp
679 675 .LP
680 676 See \fBattributes\fR(5) for descriptions of the following attributes:
681 -.sp
682 -
683 -.sp
684 677 .TS
685 678 box;
686 679 c | c
687 680 l | l .
688 681 ATTRIBUTE TYPE ATTRIBUTE VALUE
689 682 _
690 683 CSI Enabled
691 684 _
692 -Interface Stability Committed
685 +Interface Stability See below.
693 686 _
694 687 MT-Level MT-Safe
695 688 _
696 -Standard See \fBstandards\fR(5).
689 +Standard See \fBstandards\fR(5) for \fBstrptime()\fR.
697 690 .TE
698 691
692 +.LP
693 +The \fBstrptime()\fR function is Standard. The \fBstrptime_l()\fR function
694 +is Uncommitted.
699 695 .SH SEE ALSO
700 -.sp
701 696 .LP
702 697 \fBctime\fR(3C), \fBgetdate\fR(3C), \fBisspace\fR(3C), \fBmktime\fR(3C),
703 -\fBsetlocale\fR(3C), \fBstrftime\fR(3C), \fBattributes\fR(5), \fBenviron\fR(5),
698 +\fBnewlocale\fR(3C),
699 +\fBsetlocale\fR(3C), \fBstrftime\fR(3C), \fBuselocale\fR(3C),
700 +\fBattributes\fR(5), \fBenviron\fR(5),
704 701 \fBstandards\fR(5)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX