R轮次更新时间

时间:2015-06-25 13:46:08

标签: r rstudio posixct

通过加载PostgreSQL表(RPostgreSQL)到目前为止的时间轮。相反,"2015-01-28 03:04:01 CET""2015-01-28 CET",但它是类"POSIXct" "POSIXt",不仅是节目,还有"2015-01-28 00:00:00 CET"。它只在本地mac上,服务器中的R接收到同一个表没有问题。相反,任何选择。有人可以帮忙吗?

> command3 <- "SELECT requested_at FROM rides  WHERE  city_id != 1;"
> riders3 <- dbSendQuery(con, command3)
> riders_total <- fetch(riders3, n = -1)
> riders_total$requested_at[1]
[1] "2015-04-19 CEST"     #####    is "2015-04-19 03:04:31 CEST" !
> riders_total$requested_at[1] + 1
[1] "2015-04-19 00:00:01 CEST"
> dput(head(riders_total, 10))
structure(list(requested_at = structure(c(1429394400, 1429653600, 
1429653600, 1431468000, 1431468000, 1429394400, 1431468000, 1417993200, 
1430085600, 1431468000), class = c("POSIXct", "POSIXt"), tzone = "")), .Names = "requested_at", row.names = c(NA, 
10L), class = "data.frame")

1 个答案:

答案 0 :(得分:0)

在不同PC上使用Date的类似问题得到了不同的值。 找到一种解决方法(简化方式而不更改PC选项): 在select中使用to_char 然后as.POSIXct in R