How to convert unix timestamp (milliseconds) and timezone in R?

后端 未结 2 1184
-上瘾入骨i
-上瘾入骨i 2020-12-11 08:41

I have data which has two columns time and timezone that have the timestamp of events. Examples are:

time               timezone
14         


        
2条回答
  •  無奈伤痛
    2020-12-11 09:47

    I think this can be right for you.

    aa <- 1433848856453
    as.POSIXct(aa/1000, origin="1970-01-01")
    [1] "2015-06-09 13:20:56.453 CEST"
    

    Edit

    Now I've realized that my code is not reproducible, because of my personal settings, but this can fix it and let you achieve the goal.

    options(digits.secs=6)
    

提交回复
热议问题