]> git.saurik.com Git - apple/libc.git/blobdiff - stdtime/FreeBSD/strptime.3
Libc-1272.250.1.tar.gz
[apple/libc.git] / stdtime / FreeBSD / strptime.3
index c265dd894b42b3b6086f621b2a33a916cc832b01..eb8c16c1781938df1516c097973a8f42bf564e0f 100644 (file)
 .\" (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.23 2004/07/02 23:52:12 ru Exp $
+.\" $FreeBSD$
 .\" "
-.Dd January 4, 2003
+.Dd October 2, 2014
 .Dt STRPTIME 3
 .Os
 .Sh NAME
-.Nm strptime
+.Nm strptime ,
+.Nm strptime_l
 .Nd parse date and time string
 .Sh LIBRARY
 .Lb libc
 .Fa "const char * restrict format"
 .Fa "struct tm * restrict timeptr"
 .Fc
+.In time.h
+.In xlocale.h
+.Ft char *
+.Fn strptime_l "const char * restrict buf" "const char * restrict format" "struct tm * restrict timeptr" "locale_t loc"
 .Sh DESCRIPTION
 The
 .Fn strptime
@@ -53,6 +58,11 @@ and fills in the elements of the structure pointed to by
 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
@@ -71,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
@@ -104,10 +119,24 @@ 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
+format specifier expects exactly 4 digits (leaving any trailing digits for the
+next specifier).
 .Sh SEE ALSO
 .Xr date 1 ,
 .Xr scanf 3 ,
-.Xr strftime 3
+.Xr strftime 3 ,
+.Xr xlocale 3
+.Sh HISTORY
+The
+.Fn strptime
+function appeared in
+.Fx 3.0 .
 .Sh AUTHORS
 The
 .Fn strptime
@@ -115,11 +144,6 @@ function has been contributed by Powerdog Industries.
 .Pp
 This man page was written by
 .An J\(:org Wunsch .
-.Sh HISTORY
-The
-.Fn strptime
-function appeared in
-.Fx 3.0 .
 .Sh BUGS
 Both the
 .Fa %e
@@ -149,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".