rip_info() extracts all information from a date or datetime object.

rip_info(x)

Arguments

x

<Date / POSIXct / POSIXlt>

The vector to extract the information from.

Value

A named list of size 8 containing the information about x.

Examples

x <- as.Date("2019-01-01") rip_info(x)
#> $second #> [1] 0 #> #> $minute #> [1] 0 #> #> $hour #> [1] 0 #> #> $mday #> [1] 1 #> #> $month #> [1] 1 #> #> $year #> [1] 2019 #> #> $wday #> [1] 2 #> #> $yday #> [1] 1 #>
# Identical dates, but in different years a <- as.POSIXct("1969-12-31 19:00:00", tz = "America/New_York") b <- as.POSIXct("1970-01-01 00:00:00", tz = "UTC") identical(as.numeric(a), as.numeric(b))
#> [1] TRUE
rip_info(a)
#> $second #> [1] 0 #> #> $minute #> [1] 0 #> #> $hour #> [1] 0 #> #> $mday #> [1] 31 #> #> $month #> [1] 12 #> #> $year #> [1] 1969 #> #> $wday #> [1] 3 #> #> $yday #> [1] 365 #>
rip_info(b)
#> $second #> [1] 0 #> #> $minute #> [1] 0 #> #> $hour #> [1] 0 #> #> $mday #> [1] 1 #> #> $month #> [1] 1 #> #> $year #> [1] 1970 #> #> $wday #> [1] 4 #> #> $yday #> [1] 1 #>