library(lubridate) df <- read.csv("data2020.csv",col.names=c("DateTime", "DB", "RH","DP","P","WIND","WIND-DIR","SUN","RAIN","START")) datetime_string <- "01/01/2020 14:30" input_format <- "%d/%m/%Y %H:%M" # Specify the format of the input string # Convert the datetime string to a POSIXct object df$DateTime <- as.POSIXct(df$DateTime, format = input_format) # Print the POSIXct object head(df)