is.POSIXct {str2str}R Documentation

Test for a POSIXct object

Description

is.POSIXct returns whether an object is a POSIXct object (aka has class = "POSIXct").

Usage

is.POSIXct(x)

Arguments

x

an object.

Value

TRUE is x has class "POSIXct" and FALSE if x does not have class "POSIXct".

Examples

tmp <- as.POSIXlt("2021-05-24 21:49:11", tz = "America/New_York",
   format = "%Y-%m-%d %H:%M:%OS") # as.POSIXlt.character
time <- as.POSIXct(tmp) # as.POSIXct.POSIXlt
is.POSIXct(time)
class(time) <- append(class(time), "extra_class")
is.POSIXct(time) # classes other than POSIXct are allowed
is.POSIXct(list(time)) # returns FALSE

[Package str2str version 1.0.0 Index]