R cmd check note: unable to verify current time

R

R Problem Overview


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).

R Solutions


Solution 1 - R

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.

Solution 2 - R

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)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJ.C.WahlView Question on Stackoverflow
Solution 1 - RqastaView Answer on Stackoverflow
Solution 2 - RPaul WildenhainView Answer on Stackoverflow