#' @title Date to unixtime
#' @description Convert date object to unixtime object.
#'
#' @param date Insert date object as format YYYY-MM-DD. Time (hms) will default to
#' the current time derived from the current_time() function.
#'
#' @importFrom lubridate ymd_hms
#'
#' @return
#'
#' @examples
#' date_to_unix('2019-01-15')
date_to_unix <- function(date){
time <- current_time()
lubridate::ymd_hms(paste0(date, ' ', time), tz = finnhub_timezone) %>%
as.numeric
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.