R/SysDate.R

Defines functions Sys.Date

Sys.Date <- function(mock = NULL) {
  if (is_testing()) {
    return(as.Date("2022-05-26"))
  }
  if (is.null(mock)) {
    return(as.Date(as.POSIXct(Sys.time())))
  }
  return(as.Date(mock))
}

Try the grattan package in your browser

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

grattan documentation built on Sept. 4, 2023, 5:08 p.m.