add_time() appends a user-specified time to a date string to ensure that the database queries return all data for a given date. NOTE: Which database queries does this apply to?

add_time(x, time = "00:00:00")

Arguments

x

A Date string containing the date of interest. Dates must be given in the "%%B-%%d-%%Y" format.

time

A character string containing the time to be appended. Must be in the HH:MM:SS format.

Value

A character string containing the original date appended with the specified time.

Examples

date <- "July-11-2023"
date <- as.Date(date, format = "%B-%d-%Y")
time <- "12:00:00"
date_time <- add_time(date, time)