Skip to contents

Is it a Unix timestamp (seconds)?

Usage

is_unix_time(x)

Arguments

x

A character vector.

Value

Logical vector; TRUE for a 9-10 digit epoch-seconds value.

Details

Inherently loose: any 9-10 digit integer in the plausible epoch range matches. Intended as a weak signal, corrected in the DGF if wrong.

Examples

is_unix_time(c("1513036980", "946684800", "12345", NA))
#> [1]  TRUE  TRUE FALSE    NA