Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
下面的日期是什么格式,如何转换?
theData <- fromJSON(theUrl) theData["sampleDate"] $sampleDate [1] 1.439165e+12
在浏览器中查看数据,sampleDate 的值为 1439164800000。使用 jsonlite(对于很多此类东西来说是一种新的东西)
谢谢
您的数据很可能是以 Unix 时间表示的毫秒数,即毫秒(这就是我将它们除以 1000 的原因),因为1970-01-01. 尝试这个:
1970-01-01
as.POSIXct(1.439165e+12/1000, origin = "1970-01-01", tz = "UTC") [1] "2015-08-10 00:03:20 UTC"
请注意,您必须使用正确的时区参数,这里我只使用了一个来展示该参数。