.\" (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
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
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
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
.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
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".