2 .\" Copyright (c) 1997 Joerg Wunsch
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
16 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
19 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 .\" $FreeBSD: head/lib/libc/stdtime/strptime.3 272533 2014-10-04 18:00:15Z pfg $
33 .Nd parse date and time string
40 .Fa "const char * restrict buf"
41 .Fa "const char * restrict format"
42 .Fa "struct tm * restrict timeptr"
47 .Fn strptime_l "const char * restrict buf" "const char * restrict format" "struct tm * restrict timeptr" "locale_t loc"
51 function parses the string in the buffer
53 according to the string pointed to by
55 and fills in the elements of the structure pointed to by
57 The resulting values will be relative to the local time zone.
58 Thus, it can be considered the reverse operation of
62 function does the same as
64 but takes an explicit locale rather than using the current locale.
68 string consists of zero or more conversion specifications and
70 All ordinary characters are matched exactly with the buffer, where
71 white space in the format string will match any amount of white space
73 All conversion specifications are identical to those described in
76 Two-digit year values, including formats
80 are now interpreted as beginning at 1969 per POSIX requirements.
81 Years 69-00 are interpreted in the 20th century (1969-2000), years
82 01-68 in the 21st century (2001-2068).
83 Four-digit year values in
85 specifier are interpreted as days since year 1900
86 as per POSIX requirements.
91 format specifiers accept any value within the range 00 to 53.
95 format specifier accepts both RFC 822 (+hhmm) and ISO 8601 (+hhmm +hh:mm +hh Z)
96 standard time zone formats.
97 The -00, -00:00, -0000 time zone values are also accepted as per RFC 3339.
101 string does not contain enough conversion specifications to completely
102 specify the resulting
104 the unspecified members of
117 If time relative to today is desired, initialize the
119 structure with today's date before passing it to
122 Upon successful completion,
124 returns the pointer to the first character in
126 that has not been required to satisfy the specified conversions in
130 if one of the conversions failed.
132 returns the same values as
146 function has been contributed by Powerdog Industries.
148 This man page was written by
155 format specifiers may incorrectly scan one too many digits
156 if the intended values comprise only a single digit
157 and that digit is followed immediately by another digit.
158 Both specifiers accept zero-padded values,
159 even though they are both defined as taking unpadded values.
163 format specifier has no effect unless it is parsed
165 hour-related specifiers.
170 will produce undefined results.
180 format specifier only accepts time zone abbreviations of the local time zone,
182 This limitation is because of ambiguity due to of the over loading of time
186 which is both Eastern Standard Time and Eastern Australia Summer Time.
190 function does not correctly handle multibyte characters in the