Data cannot be converted to "POSIXlt" category in R

Data cannot be converted to "POSIXlt" category in

R

now there is a copy of data similar to yyyy-mm-dd hh:mm:ss format stored in the second column of Data.csv

< hr >
DateTimes <- Data[2]

>DateTimes
1    2017-01-01 00:00:00
2    2017-01-01 00:00:02
3    2017-01-01 00:00:02
4    2017-01-01 00:00:03
5    2017-01-01 00:00:05

.

want to convert to time in the following way, but always report an error

mydate <- as.POSIXlt(Data[2])

error report:

"Data[2]""POSIXlt" 

in the same case, there is no problem if you use it directly

mydate <- as.POSIXlt("2017-01-01 00:00:01" )

> mydate
[1] "2017-01-01 00:00:05 CST"

excuse me, what"s going on? How should it be solved?

R
Mar.30,2021

use mutate (df,lubridate::ymd_hms (ts))

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c0c646-3ae96.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c0c646-3ae96.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?