Loading...
stdtime/FreeBSD/strptime.3 Libc-320 Libc-825.26
--- Libc/Libc-320/stdtime/FreeBSD/strptime.3
+++ Libc/Libc-825.26/stdtime/FreeBSD/strptime.3
@@ -23,13 +23,14 @@
 .\" (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.22 2003/01/04 09:50:04 tjr Exp $
+.\" $FreeBSD: src/lib/libc/stdtime/strptime.3,v 1.24 2005/01/20 09:17:04 ru Exp $
 .\" "
 .Dd January 4, 2003
 .Dt STRPTIME 3
 .Os
 .Sh NAME
-.Nm strptime
+.Nm strptime ,
+.Nm strptime_l
 .Nd parse date and time string
 .Sh LIBRARY
 .Lb libc
@@ -37,19 +38,28 @@
 .In time.h
 .Ft char *
 .Fo strptime
-.Fa "const char * restrict buf"
-.Fa "const char * restrict format"
-.Fa "struct tm * restrict timeptr"
+.Fa "const char *restrict buf"
+.Fa "const char *restrict format"
+.Fa "struct tm *restrict tm"
+.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
 .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 timeptr .
+.Fa tm .
 The resulting values will be relative to the local time zone.
 Thus, it can be considered the reverse operation of
 .Xr strftime 3 .
@@ -78,7 +88,7 @@
 specify the resulting
 .Vt struct tm ,
 the unspecified members of
-.Va timeptr
+.Va tm
 are left untouched.
 For example, if
 .Fa format
@@ -91,9 +101,17 @@
 .Va tm_min
 will be modified.
 If time relative to today is desired, initialize the
-.Fa timeptr
+.Fa tm
 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
@@ -104,10 +122,21 @@
 It returns
 .Dv NULL
 if one of the conversions failed.
+.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 @@
 .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
@@ -161,7 +185,8 @@
 format specifier only accepts time zone abbreviations of the local time zone,
 or the value "GMT".
 This limitation is because of ambiguity due to of the over loading of time
-zone abbreviations.  One such example is
+zone abbreviations.
+One such example is
 .Fa EST
 which is both Eastern Standard Time and Eastern Australia Summer Time.
 .Pp