jonkeane commented on a change in pull request #12319:
URL: https://github.com/apache/arrow/pull/12319#discussion_r821734677



##########
File path: r/R/dplyr-funcs-datetime.R
##########
@@ -168,3 +168,23 @@ register_bindings_datetime <- function() {
     build_expr("cast", x, options = list(to_type = date32()))
   })
 }
+
+binding_format_datetime <- function(x, format = "", tz = "", usetz = FALSE) {
+  if (usetz) {
+    format <- paste(format, "%Z")
+  }
+
+  if (call_binding("is.POSIXct", x)) {
+    # the casting part might not be required once
+    # https://issues.apache.org/jira/browse/ARROW-14442 is solved
+    # TODO revisit the steps below once the PR for that issue is merged
+    if (tz == "" && x$type()$timezone() != "") {
+      tz <- x$type()$timezone()

Review comment:
       I thought I had asked this before, but I can't find it in the comments, 
so I must be making it up!
   
   Could you add a test down below for something like `arrow_table() %>% 
mutate(start_date = format(as.POSIXct("2022-01-01 01:01:00"))`
   
   I have a suspicion that using `$type()$timezone()` will error with R input 
here.




-- 
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]


Reply via email to