I have a vector of dates and times
tm <- c("20231130 162900", "20231009 75400", "20240216 3100", "20230725 0")
I convert it to time format
library(tidyverse)
strsplit(tm, " ") |>
map_chr((x) paste(x[1], stringr::str_pad(x[2], 6, "left", "0"))) |>
lubridate::ymd_hms()
result
[1] "2023-11-30 16:29:00 UTC" "2023-10-09 07:54:00 UTC" "2024-02-16 00:31:00 UTC" "2023-07-25 00:00:00 UTC"
What are some shorter and more readable options to do this conversion?