Codecov test
coverage R-CMD-check

clock is an R package for working with date-times. It is packed with features, including utilities for: parsing, formatting, arithmetic, rounding, and extraction/updating of individual components. In addition to these tools for manipulating date-times, clock provides entirely new date-time types which are structured to reduce the agony of working with time zones as much as possible. At a high-level, clock:

There are four key classes in clock, inspired by the design of the C++ date and chrono libraries. Some types are more efficient than others at particular operations, and it is only when all 4 are taken as a whole do you get a complete date time library.


Install the released version from CRAN with:


Install the development version from GitHub with:

# install.packages("remotes")


With clock, there is a high-level API for manipulating R’s native date and date-time types (Date, POSIXct, and POSIXlt), as well as a low-level API for more advanced date-time manipulations. The high-level API should allow you to quickly get productive with clock without having to learn many of the new types. An easy way to get an overview of this is by looking at the High Level API section of the pkgdown reference page.

You’ll also want to take a look at clock’s vignettes:


The ideas used to build clock have come from a number of places:

Try the clock package in your browser

Any scripts or data that you put into this service are public.

clock documentation built on July 19, 2022, 1:05 a.m.