96

When running R CMD check I get the following note:

checking for future file timestamps ... NOTE
  unable to verify current time

I have seen this discussed here, but I am not sure which files it is checking for timestamps, so I'm not sure which files I should look at. This happens locally on my windows and remotely on different systems (using github actions).

1
  • 3
    Hmmm... I got exactly the same problem 10 minutes ago.
    – Chong Tang
    Commented Aug 27, 2020 at 10:37

2 Answers 2

92

Take a look at https://svn.r-project.org/R/trunk/src/library/tools/R/check.R The check command relies on an external web resource:

now <- tryCatch({
foo <- suppressWarnings(readLines("http://worldclockapi.com/api/json/utc/now",
                                 warn = FALSE))

This resource http://worldclockapi.com/ is currently not available.

Hence the following happens (see same package source):

if (is.na(now)) {
   any <- TRUE
   noteLog(Log, "unable to verify current time")

See also references: https://community.rstudio.com/t/r-devel-r-cmd-check-failing-because-of-time-unable-to-verify-current-time/25589

So, unfortunately this requires a fix in the check function by the R development team ... or the web-resource coming online again.

0
40

To add to qasta's answer, you can silence this check by setting the _R_CHECK_SYSTEM_CLOCK_ environment variable to zero e.g Sys.setenv('_R_CHECK_SYSTEM_CLOCK_' = 0)

To silence this in a persistent manner, you can set this environment variable on R startup. One way to do so is through the .Renviron file, in the following manner:

  1. install.packages("usethis") (If not installed already)
  2. usethis::edit_r_environ()
  3. Add _R_CHECK_SYSTEM_CLOCK_=0 to the file
  4. Save, close file, restart R
2
  • How to make this persistent? After I restart RStudio I need to set this again
    – Kalaschnik
    Commented Jan 21, 2022 at 16:59
  • 5
    Have you ever used the .Renviron file? You can set global variables in there that are loaded each time you load RStudio/R. If you haven't then 1. install.packages("usethis") 2. usethis::edit_r_environ() 3. Add _R_CHECK_SYSTEM_CLOCK_=0 to the file 4. Save, close file, restart R Commented Jan 21, 2022 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.