Comparing datetimes

Is that 0, 10, 20, 30, 40, 50, 60 past the hour, treating all dates as the same date? That is what

would do. (Aside datetime objects have no format, as such, until they are converted into character strings.)

This is a different problem depending on whether the timestamps are datetime objects or character strings. See the FAQ: How to do a minimal reproducible example reprex for beginners.

For datetime objects

suppressPackageStartupMessages({
  library(lubridate)
})

a_datetime <- now()
a_datetime
#> [1] "2021-05-13 16:21:14 PDT"

round_date(a_datetime,unit = "10 minutes",week_start = getOption("lubridate.week.start", 7))
#> [1] "2021-05-13 16:20:00 PDT"