For almost all things time-related the {lubridate}
package is a sanity preserver. If your data had start/finish as variables, for example
library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following objects are masked from 'package:base':
#>
#> date, intersect, setdiff, union
# recorded as character class in data
begin <- "2022-10-22 14:43:04"
finish <- "2022-10-22 14:03:44"
# convert to datetime class
begin <- ymd_hms(begin)
finish <- ymd_hms(finish)
(elapsed <- finish - begin)
#> Time difference of -39.33333 mins
But, let's work with what you've got, which is a variable, time_rented
of character strings.
time_rented <- as.integer(gsub(" secs$","",time_rented))
assuming that the seconds are all integers and secs
is consistent.