Skip to content

Commit fa7b99b

Browse files
committed
Refine condition and update help page
As discussed and co-developed with @hturner
1 parent 8953cbc commit fa7b99b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/library/base/R/datetime.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ format.POSIXlt <- function(x, format = "", usetz = FALSE,
382382
digits = getOption("digits.secs"), ...)
383383
{
384384
if(!inherits(x, "POSIXlt")) stop("wrong class")
385-
if(any(f0 <- format == "")) {
385+
if(any(f0 <- format == "" | grepl("%OS$", format))) {
386386
## need list [ method here.
387387
times <- unlist(unclass(x)[1L:3L])[f0]
388388
np <- if(is.null(digits)) 0L else min(6L, digits)

src/library/base/man/strptime.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ strptime(x, format, tz = "")
3939
methods is
4040
\code{"\%Y-\%m-\%d \%H:\%M:\%S"} if any element has a time
4141
component which is not midnight, and \code{"\%Y-\%m-\%d"}
42-
otherwise. If \code{\link{options}("digits.secs")} is set, up to
42+
otherwise. If \code{\link{options}("digits.secs")} is set,
4343
the specified number of digits will be printed for seconds.}
4444
\item{\dots}{further arguments to be passed from or to other methods.}
4545
\item{usetz}{logical. Should the time zone abbreviation be appended

0 commit comments

Comments
 (0)