From 856efe217c2c3a7e65ea3812d8575e2c43514a14 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Thu, 18 May 2023 12:06:47 +0000 Subject: [PATCH] maybe fix --- r/R/dplyr-funcs-datetime.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/r/R/dplyr-funcs-datetime.R b/r/R/dplyr-funcs-datetime.R index 3fe08c4f46036..5b6e16d376554 100644 --- a/r/R/dplyr-funcs-datetime.R +++ b/r/R/dplyr-funcs-datetime.R @@ -61,12 +61,14 @@ register_bindings_datetime_utility <- function() { tz <- Sys.timezone() } - # if a timestamp does not contain timezone information (i.e. it is + # If a timestamp does not contain timezone information (i.e. it is # "timezone-naive") we can attach timezone information (i.e. convert it into # a "timezone-aware" timestamp) with `assume_timezone` # if we want to cast to a different timezone, we can only do it for - # timezone-aware timestamps, not for timezone-naive ones - if (!is.null(tz)) { + # timezone-aware timestamps, not for timezone-naive ones. + # strptime in Acero will return a timezone-aware timestamp if %z is + # part of the format string. + if (!is.null(tz) && !grepl("%z", format, fixed = TRUE)) { output <- Expression$create( "assume_timezone", output,