summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdtime
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-12-18 05:00:54 +0000
committertjr <tjr@FreeBSD.org>2002-12-18 05:00:54 +0000
commit2e8159ab8c94be9c23b97567d7c48b0595ba43f9 (patch)
tree8cd5dab764e2c71319de965bca3eeb111704ad4d /lib/libc/stdtime
parent9fcc701ba3d678ef4d35c0bfbb884077ddeb37fe (diff)
downloadFreeBSD-src-2e8159ab8c94be9c23b97567d7c48b0595ba43f9.zip
FreeBSD-src-2e8159ab8c94be9c23b97567d7c48b0595ba43f9.tar.gz
Document what happens when the format string contains insufficient
conversion specifications to completely specify the resulting struct tm. PR: 46331 Submitted by: Christian S.J. Peron MFC after: 2 weeks
Diffstat (limited to 'lib/libc/stdtime')
-rw-r--r--lib/libc/stdtime/strptime.323
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/libc/stdtime/strptime.3 b/lib/libc/stdtime/strptime.3
index 91b810f..69c36a7 100644
--- a/lib/libc/stdtime/strptime.3
+++ b/lib/libc/stdtime/strptime.3
@@ -71,6 +71,29 @@ 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).
+.Pp
+If the
+.Fa format
+string does not contain enough conversion specifications to completely
+specify the resulting
+.Vt struct tm ,
+the unspecified members of
+.Va timeptr
+are left untouched.
+For example, if
+.Fa format
+is
+.Dq Ql "%H:%M:%S" ,
+only
+.Va tm_hour ,
+.Va tm_sec
+and
+.Va tm_min
+will be modified.
+If time relative to today is desired, initialize the
+.Fa timeptr
+structure with today's date before passing it to
+.Fn strptime .
.Sh RETURN VALUES
Upon successful completion,
.Fn strptime
OpenPOWER on IntegriCloud