edponce commented on a change in pull request #11105:
URL: https://github.com/apache/arrow/pull/11105#discussion_r710900429
##########
File path: r/R/dplyr-functions.R
##########
@@ -672,6 +672,16 @@ nse_funcs$strptime <- function(x, format = "%Y-%m-%d
%H:%M:%S", tz = NULL, unit
Expression$create("strptime", x, options = list(format = format, unit =
unit))
}
+nse_funcs$strftime <- function(x, format = "", tz = "", usetz = FALSE) {
+ if (tz != "") {
+ arrow_not_supported("tz argument")
+ }
+ if (usetz) {
+ format = paste(format, "%Z")
Review comment:
What if `format` already contains the timezone (%Z) specifier? `paste`
command would duplicate it.
Nevertheless, R's `strftime` does not performs these type of validations:
```r
> strftime("2021-9-17", format="%Y-%m-%dd") # note the extra 'd'
[1] "2021-09-17d"
> strftime("2021-9-17", format="%Y-%m-%d %Z", usetz=TRUE) # note the use of
'%Z' and usetz
[1] "2021-09-17 EDT EDT"
```
So it is ok that this has the same behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]