← Back to all sparks
C

clock

DEVOPS
Velocity0.0

Comprehensive date-time library for R with calendar and time point types

clock is turning calendar conventions lubridate hard-coded into parameterized types.

date-timecalendar arithmetictidyversec++ interoptyped apis
Current state
clock provides typed date-time handling for R on top of the C++20 date library, with explicit calendar and time-point types instead of implicit coercion. The visible history splits between genuine arithmetic additions and a long tail of compiler and CRAN-policy repairs. Recent releases are mostly the latter, with 0.7.3 raising the tzdb and R floors.
Where it's heading
The feature arc moves toward making conventions explicit and parameterized rather than fixed: counting units between dates in 0.6.0, duration modulus and integer division alongside it, then a week-start-parameterized calendar in 0.7.0 that subsumes both ISO and CDC epidemiological weeks. Since 0.7.0 the package has added almost no surface, spending releases on C++ toolchain compliance instead. The 0.7.3 parsing change, following upstream to character-width rather than digit-count parsing, is the one recent break users must handle.
Prediction
The last three releases are maintenance-shaped, so the next most likely tracks another tzdb or compiler requirement rather than adding calendars.

Recent moves

  1. 1y ago

    Parsing switches to character widths; tzdb 0.5.0 required

    Follows the upstream date library in making %Y, %F, %G and %c parse four characters rather than four digits, which breaks negative years under %Y-%m-%d, and raises the floors to tzdb 0.5.0 and R 4.0.0. A correctness alignment that users with historical dates must act on.

    View source ↗
  2. 1y ago

    diff() method added for time points and calendars

    Adds diff() methods that always return durations, including for empty input, alongside compiler fixes for older gcc. Small, but it closes a type-consistency gap that matters in a package whose premise is predictable types.

    View source ↗
  3. 2y ago

    Internal C++ cleanup for CRAN warnings

    Replaces a non-API C entry point and silences a templated-constructor warning reported by CRAN. Compliance work with no user-facing effect.

    View source ↗
  4. 3y ago

    year_week_day() calendar and spanning sequences added

    ⚡ SPARK

    The high point of the visible history: a new parameterized week-based calendar, sequence generators spanning a vector's full range, and low-level helpers for time zone transitions, plus a breaking change to how durations and time points are stored. Everything since has been maintenance.

    View source ↗
  5. 4y ago

    Zero-length sequences allowed; dependency floors raised

    Lets date_seq() and the seq() methods return a size-zero result when from is past to rather than erroring, matching rlang conventions, and fixes as.POSIXct() precision promotion. The rest is dependency floor-raising across tzdb, vctrs, rlang and cpp11.

    View source ↗
  6. 4y ago

    date_count_between() and duration modulus arithmetic

    Adds counting of whole units between two dates, covering common cases like age in years, and defines modulus and integer division on durations. Fills in arithmetic that users previously hand-rolled.

    View source ↗