dragosmg commented on a change in pull request #12319:
URL: https://github.com/apache/arrow/pull/12319#discussion_r821830025
##########
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:
(that was back in the days when my logic was split between _Expression_
and _regular_ R object)
--
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]