OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man3 / strptime.3
index 1630a76..19068e6 100644 (file)
@@ -28,7 +28,7 @@
 .\" Modified, aeb, 2001-08-31
 .\" Modified, wharms 2001-11-12, remark on white space and example
 .\"
-.TH STRPTIME 3 2009-12-05 "GNU" "Linux Programmer's Manual"
+.TH STRPTIME 3 2014-01-17 "GNU" "Linux Programmer's Manual"
 .SH NAME
 strptime \- convert a string representation of time to a time tm structure
 .SH SYNOPSIS
@@ -41,18 +41,47 @@ strptime \- convert a string representation of time to a time tm structure
 .SH DESCRIPTION
 The
 .BR strptime ()
-function is the converse function to
-.BR strftime (3)
-and converts the character string pointed to by
+function is the converse of
+.BR strftime (3);
+it converts the character string pointed to by
 .I s
 to values which are stored in the
-.I tm
+"broken-down time"
 structure pointed to by
 .IR tm ,
 using the format specified by
 .IR format .
-Here
+
+The broken-down time structure
+.I tm
+is defined in
+.IR <time.h>
+as follows:
+.sp
+.in +4n
+.nf
+struct tm {
+    int tm_sec;    /* Seconds (0-60) */
+    int tm_min;    /* Minutes (0-59) */
+    int tm_hour;   /* Hours (0-23) */
+    int tm_mday;   /* Day of the month (1-31) */
+    int tm_mon;    /* Month (0-11) */
+    int tm_year;   /* Year - 1900 */
+    int tm_wday;   /* Day of the week (0-6, Sunday = 0) */
+    int tm_yday;   /* Day in the year (0-365, 1 Jan = 0) */
+    int tm_isdst;  /* Daylight saving time */
+};
+.fi
+.in
+
+For more details on the
+.I tm
+structure, see
+.BR ctime (3).
+
+The
 .I format
+argument
 is a character string that consists of field descriptors and text characters,
 reminiscent of
 .BR scanf (3).
@@ -74,11 +103,11 @@ function processes the input string from left
 to right.
 Each of the three possible input elements (whitespace,
 literal, or format) are handled one after the other.
-If the input cannot be matched to the format string the function stops.
+If the input cannot be matched to the format string, the function stops.
 The remainder of the format and input strings are not processed.
 .PP
 The supported input field descriptors are listed below.
-In case a text string (such as a weekday or month name)
+In case a text string (such as the name of a day of the week or a month name)
 is to be matched, the comparison is case insensitive.
 In case a number is to be matched, leading zeros are
 permitted but not required.
@@ -89,7 +118,7 @@ The
 character.
 .TP
 .BR %a " or " %A
-The weekday name according to the current locale,
+The name of the day of the week according to the current locale,
 in abbreviated form or the full name.
 .TP
 .BR %b " or " %B " or " %h
@@ -145,7 +174,7 @@ If
 .I t_fmt_ampm
 is empty in the
 .B LC_TIME
-part of the current locale
+part of the current locale,
 then the behavior is undefined.
 .TP
 .B %R
@@ -168,7 +197,7 @@ The week number with Sunday the first day of the week (0-53).
 The first Sunday of January is the first day of week 1.
 .TP
 .B %w
-The weekday number (0-6) with Sunday = 0.
+The ordinal number of the day of the week (0-6), with Sunday = 0.
 .TP
 .B %W
 The week number with Monday the first day of the week (0-53).
@@ -245,8 +274,8 @@ The week number of the year (Sunday as the first day of the week)
 using the locale's alternative numeric symbols.
 .TP
 .B %Ow
-The number of the weekday (Sunday=0) using the locale's alternative
-numeric symbols.
+The ordinal number of the day of the week (Sunday=0),
+ using the locale's alternative numeric symbols.
 .TP
 .B %OW
 The week number of the year (Monday as the first day of the week)
@@ -256,41 +285,19 @@ using the locale's alternative numeric symbols.
 The year (offset from
 .BR %C )
 using the locale's alternative numeric symbols.
-.LP
-The broken-down time structure
-.I tm
-is defined in
-.IR <time.h>
-as follows:
-.sp
-.in +4n
-.nf
-struct tm {
-    int tm_sec;        /* seconds */
-    int tm_min;        /* minutes */
-    int tm_hour;       /* hours */
-    int tm_mday;       /* day of the month */
-    int tm_mon;        /* month */
-    int tm_year;       /* year */
-    int tm_wday;       /* day of the week */
-    int tm_yday;       /* day in the year */
-    int tm_isdst;      /* daylight saving time */
-};
-.fi
-.in
 .SH RETURN VALUE
 The return value of the function is a pointer to the first character
 not processed in this function call.
 In case the input string
-contains more characters than required by the format string the return
+contains more characters than required by the format string, the return
 value points right after the last consumed input character.
 In case
-the whole input string is consumed the return value points to the null
+the whole input string is consumed, the return value points to the null
 byte at the end of the string.
 If
 .BR strptime ()
 fails to match all
-of the format string and therefore an error occurred the function
+of the format string and therefore an error occurred, the function
 returns NULL.
 .SH CONFORMING TO
 SUSv2, POSIX.1-2001.
@@ -337,7 +344,7 @@ For reasons of symmetry, glibc tries to support for
 .BR strptime ()
 the same format characters as for
 .BR strftime (3).
-(In most cases the corresponding fields are parsed, but no field in
+(In most cases, the corresponding fields are parsed, but no field in
 .I tm
 is changed.)
 This leads to
@@ -425,3 +432,12 @@ main(void)
 .BR scanf (3),
 .BR setlocale (3),
 .BR strftime (3)
+.SH COLOPHON
+This page is part of release 3.68 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.