timechange (version 0.0.2)

time_get: Get components of a date-time object

Description

Get components of a date-time object

Usage

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

Value

A data.frame of the requested components

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.

Examples

Run this code
x <- as.POSIXct("2019-02-03")
time_get(x)

Run the code above in your browser using DataLab