Learn R Programming

One4All (version 0.5)

is.POSIXct: Check if an object is of class POSIXct

Description

This function checks if the given object is of class POSIXct. It returns TRUE if the object inherits the POSIXct class, otherwise FALSE.

Usage

is.POSIXct(x)

Value

A logical value indicating if the input object is of class POSIXct.

Arguments

x

An object to be tested for POSIXct class inheritance.

Examples

Run this code
x <- as.POSIXct("2021-01-01")
is.POSIXct(x) # TRUE

y <- Sys.Date()
is.POSIXct(y) # FALSE

Run the code above in your browser using DataLab