Is x a Date object?

is.Date(x)

Arguments

x

an R object

Value

TRUE if x is a Date object, FALSE otherwise.

See also

is.instant(), is.timespan(), is.POSIXt()

Examples

is.Date(as.Date("2009-08-03")) # TRUE
#> [1] TRUE
is.Date(difftime(now() + 5, now())) # FALSE
#> [1] FALSE