Skip to content

Commit

Permalink
Fixing issues when fetching dates from SQLite. Fixes #150
Browse files Browse the repository at this point in the history
  • Loading branch information
schuemie committed Jul 29, 2021
1 parent 49a55c1 commit 82dfe62
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions R/Sql.R
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,11 @@ convertFields <- function(dbms, result) {
if (dbms == "sqlite") {
for (colname in colnames(result)) {
if (grepl("DATE$", colname)) {
result[[colname]] <- as.Date(as.POSIXct(result[[colname]], origin = "1970-01-01", tz = "GMT"))
result[[colname]] <- as.Date(as.POSIXct(as.numeric(result[[colname]]), origin = "1970-01-01", tz = "GMT"))
}
if (grepl("DATETIME$", colname)) {
result[[colname]] <- as.POSIXct(result[[colname]], origin = "1970-01-01", tz = "GMT")
result[[colname]] <- as.POSIXct(as.numeric(result[[colname]]), origin = "1970-01-01", tz = "GMT")
}

}
}
if (dbms %in% c("bigquery")) {
Expand Down

0 comments on commit 82dfe62

Please sign in to comment.