Error: Invalid input: time_trans works with objects of class POSIXct only

Hi xuanhien , welcome to the forum

I do not think we can help without some sample data.
A handy way to supply some sample data is the dput() function. In the case of a large dataset something like dput(head(mydata, 100)) should supply the data we need. Just do dput(mydata) where mydata is your data. Copy the output and paste it here.

For some general information see FAQ