Skip to content

Commit 6c65d04

Browse files
author
maechler
committed
improve & update to recent code fixes
git-svn-id: https://svn.r-project.org/R/trunk@87428 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 1b1347d commit 6c65d04

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

src/library/base/man/strptime.Rd

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ strptime(x, format, tz = "")
4444
the specified number of digits will be printed for seconds, using
4545
\code{"\%OS<n>"} instead of \code{"\%S"} in the format, see also
4646
\sQuote{Details}.}
47-
\item{\dots}{further arguments to be passed from or to other methods.}
47+
\item{\dots}{further arguments to be passed from or to other methods; for
48+
\code{strftime()}, notably \code{digits}, passed to \code{format(<POSIXlt>)}.}
4849
\item{usetz}{logical. Should the time zone abbreviation be appended
4950
to the output? This is used in printing times, and more reliable
5051
than using \code{"\%Z"}.}
@@ -237,13 +238,20 @@ strptime(x, format, tz = "")
237238
the standard interpretation.
238239
239240
Specific to \R is \code{\%OSn}, which for output gives the seconds
240-
truncated to \code{0 <= n <= 6} decimal places (and if \code{\%OS} is
241-
not followed by a digit, it uses \code{digits} unless that is
242-
\code{NULL}, when \code{n = 0}). Note that the precedence is
243-
\code{format="...\%OSn"} \eqn{\ll}{>>} \code{digits = n} \eqn{\ll}{>>}
244-
\code{getOption("digits.secs")}. Further, for \code{strptime}
245-
\code{\%OS} will input seconds including fractional seconds. Note that
246-
\code{\%S} does not read fractional parts on output.
241+
truncated to exactly \code{0 <= n <= 6} decimal places. If \code{\%OS} is
242+
not followed by a digit, it uses up to \code{digits} decimals (only as
243+
many as necessary, i.e., not producing extra trailing zeros.
244+
The default \code{digits = NULL} corresponds to \code{digits = 0}.
245+
246+
Note that the precedence is \code{format=".. \%OSn .."} \eqn{\ll}{>>}
247+
\code{digits = n}, the latter initialized by default from
248+
\code{getOption("digits.secs")}.
249+
Currently, for output (\code{strftime()} and \code{format(<POSIX.t>)}),
250+
only \emph{one} "\%OS" occurence is handled (per format string).
251+
\cr
252+
Further, for \code{strptime} \code{\%OS} will input seconds including
253+
fractional seconds (to full precison). Note that \code{\%S} does not
254+
read or write fractional parts.
247255
248256
The behaviour of other conversion specifications (and even if other
249257
character sequences commencing with \code{\%} \emph{are} conversion

0 commit comments

Comments
 (0)