My date data comes with this type of format
a = structure(list(P_FPrescripcion = "2021-01-02T00:00:00"), row.names = c(NA,
-1L), class = c("tbl_df", "tbl", "data.frame"))
im trying to maintain just the date portion of the data: 2021-01-02
i have used the as.date command multiple times before but im having trouble using it this time. This is the code i have so far:
as.Date(a, format="%Y-%m-%dT%H:%M:%S")