![](/img/trans.png)
[英]Is there an R function for reading a Date in a date_isoweek format?
[英]reading OData date format in R
我正在讀取從OData導出的csv文件,遇到的日期格式如下: /Date(1391514600000)/
。
關於如何將其轉換為R中的Date
或POSIX
任何想法?
這是Unix紀元時間(以毫秒為單位)。
x <- "/Date(1391514600000)/"
x <- as.numeric(gsub("[^0-9]", "", x))
x
# [1] 1391514600000
# from milliseconds to seconds:
x <- x / 1000
as.POSIXct(x, origin="1970-01-01", tz="GMT")
# [1] "2014-02-04 11:50:00 GMT"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.