time_get: Get components of a date-time object

Description Usage Arguments Value Examples

View source: R/get.R

Description

Get components of a date-time object

Usage

1
2
3
4
5
time_get(
  time,
  components = c("year", "month", "yday", "mday", "wday", "hour", "minute", "second"),
  week_start = getOption("timechange.week_start", 1)
)

Arguments

time

a date-time object

components

a character vector of components to return. Component is one of "year", "month", "yday", "day", "mday", "wday", "hour", "minute", "second" where "day" is the same as "mday".

week_start

week starting day (Default is 1, Monday). Set timechange.week_start option to change this globally.

Value

A data.frame of the requested components

Examples

1
2
x <- as.POSIXct("2019-02-03")
time_get(x)

timechange documentation built on Jan. 13, 2021, 5:19 p.m.