inst/tinytest/test_calc_unique.R

library(anytime)

now <- Sys.time()
times <- sample(format(now + 1:10), 1000, replace=TRUE)
expect_equal(anytime(times), anytime(times, calcUnique=TRUE))
expect_equal(utctime(times), utctime(times, calcUnique=TRUE))

today <- Sys.Date()
dates <- sample(format(today + 1:10), 1000, replace=TRUE)
expect_equal(anytime(dates), anytime(dates, calcUnique=TRUE))
expect_equal(utctime(dates), utctime(dates, calcUnique=TRUE))

Try the anytime package in your browser

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

anytime documentation built on Aug. 28, 2020, 1:12 a.m.