to_times: To Times Objects from POSIX or Chron Objects

View source: R/to_times.R

to_timesR Documentation

To Times Objects from POSIX or Chron Objects

Description

Create a times object in the chron package by taking only the elements of time from a POSIXlt or POSIXct object or chron object in chron package.

Usage

to_times(x, tz = "")

Arguments

x

POSIXct or PSIXlt objcet or chron object to be converted to times object.

tz

a character string specifying the time zone to be used for the conversion. System-specific (see as.POSIXlt), but "" is the current time zone, and "GMT" is UTC. Invalid values are most commonly treated as UTC, on some platforms with a warning.

Details

If the POSIXct object differs from the system time zone, the time zone must also be specified within to_times.

Examples

x <- as.POSIXlt(Sys.time())
to_times(x)

indenkun/infun documentation built on April 17, 2025, 2:52 p.m.