Given how vibrant the R universe is, I am sure there is a package that implements what you are looking for. You should keep looking. However, what I bring to you is a solution in base R:
# The time now (which should be similar to the output of your call to lubridate::mdy_hms()
d <- Sys.time()
d
[1] "2022-03-13 00:50:10 CST"
# Extract the time
time_string <- format(d, "%H:%M:%S")
# Convert the time to AM/PM format
format(strptime(time_string, "%H:%M:%S"), "%I:%M %p")
[1] "12:50 AM"
Finally, you can extract the date from d and paste the AM/PM time to it.
Here is a function which combines all the steps above for you. x is the result of your call to lubridate::mdy_hms():
mdy_hms2 <- function(x){
date_string <- format(x, "%Y-%m-%d")
time_string <- format(x, "%H:%M:%S")
time_string2 <- strptime(time_string, format = "%H:%M:%S") |>
format("%I:%M %p")
paste(date_string, time_string2)
}
d <- mdy_hms("03-12-2022 19:17:51")
mdy_hms2(d)
[1] "2022-03-12 07:17 PM"