R/date_to_unix.R

Defines functions date_to_unix

Documented in date_to_unix

#' Date To Unix
#' @description Basic 'util' function to transform date-like values into unix. This is necessary for the Yahoo API.
#' @param Date String that can be transformed into Date format.
#' @keywords internal
date_to_unix <- function(Date) {
  posixct <- as.POSIXct(as.Date(Date, origin = "1970-01-01"))
  trunc(as.numeric(posixct))
}

Try the rfinance package in your browser

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

rfinance documentation built on Oct. 26, 2021, 9:07 a.m.