Skip to content

Commit

Permalink
change timestamp mask, fixes 1865 (tidyverse#1866)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregrahn authored and hadley committed May 31, 2016
1 parent 9f1b19e commit a143faf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/sql-escape.r
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ escape.Date <- function(x, parens = NA, collapse = ", ", con = NULL) {

#' @export
escape.POSIXt <- function(x, parens = NA, collapse = ", ", con = NULL) {
x <- strftime(x, "%Y-%m-%d %H:%M:%S", tz = "UTC")
x <- strftime(x, "%Y-%m-%dT%H:%M:%OSZ", tz = "UTC")
escape.character(x, parens = parens, collapse = collapse, con = con)
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-sql-escape.r
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ test_that("missing vaues become null", {

test_that("times are converted to ISO 8601", {
x <- ISOdatetime(2000, 1, 2, 3, 4, 5, tz = "US/Central")
expect_equal(escape(x), sql("'2000-01-02 09:04:05'"))
expect_equal(escape(x), sql("'2000-01-02T09:04:05Z'"))
})

0 comments on commit a143faf

Please sign in to comment.