]> git.saurik.com Git - apple/libc.git/blobdiff - stdtime/FreeBSD/strptime.3
Libc-1158.1.2.tar.gz
[apple/libc.git] / stdtime / FreeBSD / strptime.3
index a9c25f98db7c9c121e47ab60b680221b15b35ab3..eb8c16c1781938df1516c097973a8f42bf564e0f 100644 (file)
@@ -23,9 +23,9 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/lib/libc/stdtime/strptime.3,v 1.24 2005/01/20 09:17:04 ru Exp $
+.\" $FreeBSD$
 .\" "
-.Dd January 4, 2003
+.Dd October 2, 2014
 .Dt STRPTIME 3
 .Os
 .Sh NAME
 .In time.h
 .Ft char *
 .Fo strptime
-.Fa "const char *restrict buf"
-.Fa "const char *restrict format"
-.Fa "struct tm *restrict tm"
+.Fa "const char * restrict buf"
+.Fa "const char * restrict format"
+.Fa "struct tm * restrict timeptr"
 .Fc
 .In time.h
 .In xlocale.h
 .Ft char *
-.Fo strptime_l
-.Fa "const char *restrict buf"
-.Fa "const char *restrict format"
-.Fa "struct tm *restrict tm"
-.Fa "locale_t loc"
-.Fc
+.Fn strptime_l "const char * restrict buf" "const char * restrict format" "struct tm * restrict timeptr" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn strptime
 function parses the string in the buffer
-.Fa buf ,
+.Fa buf
 according to the string pointed to by
 .Fa format ,
 and fills in the elements of the structure pointed to by
-.Fa tm .
+.Fa timeptr .
 The resulting values will be relative to the local time zone.
 Thus, it can be considered the reverse operation of
 .Xr strftime 3 .
+The
+.Fn strptime_l
+function does the same as
+.Fn strptime ,
+but takes an explicit locale rather than using the current locale.
 .Pp
 The
 .Fa format
@@ -81,6 +81,11 @@ and
 are now interpreted as beginning at 1969 per POSIX requirements.
 Years 69-00 are interpreted in the 20th century (1969-2000), years
 01-68 in the 21st century (2001-2068).
+The
+.Fa \&%U
+and
+.Fa %W
+format specifiers accept any value within the range 00 to 53.
 .Pp
 If the
 .Fa format
@@ -88,7 +93,7 @@ string does not contain enough conversion specifications to completely
 specify the resulting
 .Vt struct tm ,
 the unspecified members of
-.Va tm
+.Va timeptr
 are left untouched.
 For example, if
 .Fa format
@@ -101,17 +106,9 @@ and
 .Va tm_min
 will be modified.
 If time relative to today is desired, initialize the
-.Fa tm
+.Fa timeptr
 structure with today's date before passing it to
 .Fn strptime .
-.Pp
-While the
-.Fn strptime
-function uses the current locale, the
-.Fn strptime_l
-function may be passed a locale directly. See
-.Xr xlocale 3
-for more information.
 .Sh RETURN VALUES
 Upon successful completion,
 .Fn strptime
@@ -122,6 +119,9 @@ that has not been required to satisfy the specified conversions in
 It returns
 .Dv NULL
 if one of the conversions failed.
+.Fn strptime_l
+returns the same values as
+.Fn strptime .
 .Sh LEGACY DESCRIPTION
 In legacy mode, the
 .Fa %Y
@@ -173,14 +173,6 @@ and 12PM
 is taken as noon.
 .Pp
 The
-.Fa %U
-and
-.Fa %W
-format specifiers accept any value within the range 00 to 53
-without validating against other values supplied (like month
-or day of the year, for example).
-.Pp
-The
 .Fa %Z
 format specifier only accepts time zone abbreviations of the local time zone,
 or the value "GMT".