Title: | Fast General Purpose Date/Time Converter |
---|---|
Description: | Fast general purpose date/time converter using 'Rust'. The package implements date time, date and epoch time parser for heterogeneous vectors of dates. |
Authors: | David Schoch [aut, cre] , Rollie Ma [ctb, cph] (author of dateparser : <https://github.com/waltzofpearls/dateparser>), Brandon W. Maister [ctb, cph] (author of chrono : <https://github.com/chronotope/chrono>), Dirkjan Ochtman [ctb, cph] (author of chrono : <https://github.com/chronotope/chrono>), Seonghoon Kang [ctb, cph] (author of chrono : <https://github.com/chronotope/chrono>), Eric Sheppard [ctb, cph] (author of chrono : <https://github.com/chronotope/chrono>), Paul Dicker [ctb, cph] (author of chrono : <https://github.com/chronotope/chrono>) |
Maintainer: | David Schoch <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.4.9000 |
Built: | 2024-11-16 05:50:48 UTC |
Source: | https://github.com/schochastics/timeless |
A benchmark dataset with different date formats
bench_date
bench_date
An object of class character
of length 93.
Fast general purpose parser for date(time) from input data
chronos(x, formats = NULL, tz = "", to_tz = "", out_format = "datetime")
chronos(x, formats = NULL, tz = "", to_tz = "", out_format = "datetime")
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". |
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.
A character vector which can be transformed to POSIXct
or date
parse_datetime, parse_date, and parse_epoch if you need more control over formatting
chronos(bench_date)
chronos(bench_date)
Parse date from strings using different formats
parse_date(x, formats = NULL, out_date = "%Y-%m-%d")
parse_date(x, formats = NULL, out_date = "%Y-%m-%d")
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. |
out_date |
character defining the date format of the parsed strings |
character vector of parsed dates.
Parse datetime from strings using different formats
parse_datetime(x, formats = NULL, out_datetime = "%Y-%m-%d %H:%M:%S")
parse_datetime(x, formats = NULL, out_datetime = "%Y-%m-%d %H:%M:%S")
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. |
out_datetime |
character defining the datetime format of the parsed strings |
character vector of parsed datetimes
Parse datetime from epoch
parse_epoch(x, tz = "", out_datetime = "%Y-%m-%d %H:%M:%S")
parse_epoch(x, tz = "", out_datetime = "%Y-%m-%d %H:%M:%S")
x |
A vector with date(time) expressions to be parsed and converted. |
tz |
timezone of output datetime. If "", uses local timezone |
out_datetime |
character defining the datetime format of the parsed strings |
character vector of parsed dates.