我有一个包含" the beginning of time interval expressed as the number of millisecond elapsed from the Unix Epoch on January 1st, 1970 at UTC."值的变量(根据数据源元数据)
这是头:
x $ timeInt [1] 1.388068e 12 1.388075e 12 1.388096e 12 1.388051e 12 1.388051e 12 1.388072e 12
所以我尝试将其转换为POSIXct
as.POSIXct(x$timeInt, origin = '01-01-1970',tz='UTC')
但我得到了这个结果
[1] "43987-03-01 05:20:00 UTC" "43987-05-23 13:20:00 UTC" "43988-01-28 13:20:00 UTC" "43986-08-25 17:20:00 UTC"
[5] "43986-08-25 17:20:00 UTC" "43987-04-25 18:40:00 UTC"
如你所见,这一年是完全错误的 . 我尝试使用其他格式,如“1970-01-01”,但结果是一样的 . 我知道数据是在2013年12月拍摄的 .
1 回答
你需要注意,这是以毫秒为单位,所以:
然后是两种方法之一:
要么