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))
}
aljrico/rfinance documentation built on March 29, 2024, 2:31 a.m.