chronos {timeless} | R Documentation |
Fast general purpose parser for date(time) from input data
Description
Fast general purpose parser for date(time) from input data
Usage
chronos(x, formats = NULL, tz = "", to_tz = "", out_format = "datetime")
Arguments
x |
A vector with date(time) expressions to be parsed and converted. |
formats |
character vector of formats to try out (see base::strptime). If NULL, uses a set of predefined formats mostly taken from the anytime package. |
tz |
assumed input timezone. If "", uses local timezone. See details |
to_tz |
convert datetime to timezone given in to_tz. If "", tz is used. See details |
out_format |
character. Defining the format of the returned result. Can be "datetime", "date", or "character". |
Details
The internal parsing is done "timezoneless". The timezone given in tz is just added to the datetime without any conversion. If to_tz is given, a conversion is made from tz to to_tz.
Value
A character vector which can be transformed to POSIXct
or date
See Also
parse_datetime, parse_date, and parse_epoch if you need more control over formatting
Examples
chronos(bench_date)