0

i load on local computer (Mac) with RPostgreSQL file from PostgreSQL and i have time instead of "2015-02-03 12:12:12" "2015-02-03". i need true time, please help.

library(RPostgreSQL)
command <- "SELECT * FROM xxx;"
xxx <- dbSendQuery(con, xxx)

OR

xxx <- dbReadTable(con, "xxx")

class(xxx$time)
[1] "POSIXct" "POSIXt" 
akrun
  • 874,273
  • 37
  • 540
  • 662
Shen
  • 183
  • 1
  • 10
  • If your data is of class `POSIXct` or `POSIXlt` it does contain complete time and date information, even though it might not be printed that way. Try `strptime(xxx$time, "%Y-%m-%d %H:%M:%S")` to convert it to text. – Backlin Jun 09 '15 at 12:25
  • Thank you. But i have time without hours, minutes and seconds: > summary(xxx$time) Min. 1st Qu. Median Mean 3rd Qu. Max. "2014-02-21 00:00:00" "2014-11-26 00:00:00" "2015-02-05 00:00:00" "2015-01-26 14:23:39" "2015-04-17 00:00:00" "2015-06-09 00:00:00" – Shen Jun 09 '15 at 12:39

0 Answers0