Management of DATES

You can use tidyr::separate() see this example

library(tidyverse)

sample_df <- data.frame(
    date = c("2015-01-01 08:10:00 AM")
)

sample_df %>%
    separate(date, into = c("year", "month", "day", "hour"), extra = "drop")
#>   year month day hour
#> 1 2015    01  01   08

Created on 2020-04-29 by the reprex package (v0.3.0)

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

1 Like