Converting character to timestamp in dataframe

后端 未结 2 1638
予麋鹿
予麋鹿 2021-01-22 07:37

I have a timestamp in a dataframe that is recognized as a character class. For some reason, I am not able to convert it to a poxis timestamp.

Here is a sample of the da

2条回答
  •  故里飘歌
    2021-01-22 07:51

    We can use anytime

    library(anytime)
    anytime('2016-11-01T00:15:00.000Z')
    #[1] "2016-11-01 00:15:00 IST"
    

    Or use strptime

    strptime('2016-11-01T00:15:00.000Z', '%Y-%m-%dT%H:%M:%OSZ')
    #[1] "2016-11-01 00:15:00 IST"
    

提交回复
热议问题