Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db <- odbcDriverConnect(connection = "Driver={SQL Server Native Client 10.0};Server=server; Database=db;Trusted_Connection=yes;")
- results <- sqlQuery(db, "select timestamp from table where some-restriction")
- attr(results$timestamp,"tzone") <- "UTC"
- results$timestamp <- as.POSIXlt(results$timestamp)
- tm <- as.POSIXlt(Sys.time())
- tm
- [1] "2011-09-20 13:45:01 BST"
- attr(tm,"tzone") <- "UTC"
- tm
- [1] "2011-09-20 13:45:01 UTC"
- library(lubridate)
- tz(results) <- "UTC"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement