This is a compare function of time. It extracts the hours, minutes and seconds to check if it falls in specified time range.

BetweenTime(x, interval)

Arguments

x

A POSIXt class vector.

interval

A character vector of boundary values, each element should be in format "hh:mm".

Value

TRUE or FALSE.

Examples

x <- lubridate::ymd_hms("2019-01-02 07:30:00") flightscanner:::BetweenTime(x, c("7:30", "8:00"))
#> [1] TRUE
flightscanner:::BetweenTime(x, c("6:00", "7:29"))
#> [1] FALSE