seq()methods for the calendar, time point, and duration types now allow
from > towhen
by > 0. This now results in a size zero result rather than an error, which is more in line with
rlang::seq2()and generally has more useful programmatic properties (#282).
Removed the dependency on ellipsis in favor of the equivalent functions in rlang (#288).
Updated tests related to writing UTF-8 on Windows and testthat 3.1.2 (#287).
Updated all snapshot tests to use rlang 1.0.0 (#285).
tzdb >=0.3.0 is now required to get access to the latest time zone database information (2022a).
vctrs >=0.4.1 and rlang >=1.0.4 are now required (#297).
cpp11 >=0.4.2 is now required to ensure that a fix related to unwind protection is included.
R >=3.4.0 is now required. This is consistent with the standards of the tidyverse.
CRAN release: 2021-12-02
time_point_count_between()for computing the number of units of time between two dates (i.e. the number of years, months, days, or seconds). This has a number of uses, like computing the age of an individual in years, or determining the number of weeks that have passed since the start of the year (#266).
Modulus is now defined between a duration vector and an integer vector through
<duration> %% <integer>. This returns a duration vector containing the remainder of the division (#273).
Integer division is now defined for two duration objects through
<duration> %/% <duration>. This always returns an integer vector, so be aware that using very precise duration objects (like nanoseconds) can easily generate a division result that is outside the range of an integer. In that case, an
NAis returned with a warning.
CRAN release: 2021-10-29
sys_time_parse_RFC_3339()for parsing date-time strings in the RFC 3339 format. This format is a subset of ISO 8601 representing the most common date-time formats seen in internet protocols, and is particularly useful for parsing date-time strings returned by an API. The default format parses strings like
"2019-01-01T01:02:03Z"but can be adjusted to parse a numeric offset from UTC with the
offsetargument, which can parse strings like
To align more with RFC 3339 and ISO 8601 standards, the default formats used in many of the date formatting and parsing functions have been slightly altered. The following changes have been made:
Further improved documentation of undefined behavior resulting from attempting to parse sub-daily components of a string that is intended to be parsed into a Date (#258).
Bumped required minimum version of tzdb to 0.2.0 to get access to the latest time zone database information (2021e) and to fix a Unicode bug on Windows.
CRAN release: 2021-07-22
date_end()for computing the date at the start or end of a particular
precision, such as the “end of the month” or the “start of the year”. These are powered by
calendar_end(), which allow for even more flexible calendar-specific boundary generation, such as the “last moment in the fiscal quarter” (#232).
tzdb 0.1.2 is now required, which fixes compilation issues on RHEL7/Centos (#234).
CRAN release: 2021-06-28
Parsing into a date-time type that is coarser than the original string is now considered ambiguous and undefined behavior. For example, parsing a string with fractional seconds using
naive_time_parse(x, precision = "second")is no longer considered correct. Instead, if you only require second precision from such a string, parse the full string, with fractional seconds, into a clock type that can handle them, then round to seconds using whatever rounding convention is required for your use case, such as
x <- c("2019-01-01 00:00:59.123", "2019-01-01 00:00:59.556") x <- naive_time_parse(x, precision = "millisecond") x #> <time_point<naive><millisecond>> #>  "2019-01-01 00:00:59.123" "2019-01-01 00:00:59.556" x <- time_point_round(x, "second") x #> <time_point<naive><second>> #>  "2019-01-01 00:00:59" "2019-01-01 00:01:00" as_date_time(x, "America/New_York") #>  "2019-01-01 00:00:59 EST" "2019-01-01 00:01:00 EST"
Preemptively updated tests related to upcoming changes in testthat (#236).
CRAN release: 2021-04-22
clock now uses the tzdb package to access the date library’s API. This means that the experimental API that was to be used for vroom has been removed in favor of using the one exposed in tzdb.
CRAN release: 2021-04-12
clock now interprets R’s Date class as naive-time rather than sys-time. This means that it no longer assumes that Date has an implied time zone of UTC (#203). This generally aligns better with how users think Date should work. This resulted in the following changes:
date_zone()now errors with Date input, as naive-times do not have a specified time zone.
date_parse()now parses into a naive-time, rather than a sys-time, before converting to Date. This means that
%Zare now completely ignored.
The zoned-time method for
as.Date()now converts to Date through an intermediate naive-time, rather than a sys-time. This means that the printed date will always be retained, which is generally what is expected.
The Date method for
as_zoned_time()now converts to zoned-time through an intermediate naive-time, rather than a sys-time. This means that the printed date will always attempt to be retained, if possible, which is generally what is expected. In the rare case that daylight saving time makes a direct conversion impossible,
ambiguouscan be used to resolve any issues.
as_date_time()for converting to Date and POSIXct respectively. Unlike
as.POSIXct(), these functions always treat Date as a naive-time type, which results in more consistent and intuitive conversions. Note that
as_date()does conflict with
lubridate::as_date(), and the lubridate version handles Dates differently (#209).
Added two new convenient helpers (#197):
Fixed a bug where converting from a time point to a Date or POSIXct could round incorrectly (#205).
Errors resulting from invalid dates or nonexistent/ambiguous times are now a little nicer to read through the usage of an info bullet (#200).
Formatting a naive-time with
%znow warns that there were format failures (#204).
Fixed a Solaris ambiguous behavior issue from calling
Linking against cpp11 0.2.7 is now required to fix a rare memory leak issue.
Exposed an extremely experimental and limited C++ API for vroom (#322).