rok commented on a change in pull request #10647:
URL: https://github.com/apache/arrow/pull/10647#discussion_r671518524
##########
File path: cpp/src/arrow/compute/kernels/scalar_temporal_test.cc
##########
@@ -216,5 +216,40 @@ TEST_F(ScalarTemporalTest, DayOfWeek) {
DayOfWeek(timestamps,
DayOfWeekOptions(/*one_based_numbering=*/false,
/*week_start=*/8)));
}
+
+#ifndef _WIN32
+TEST_F(ScalarTemporalTest, Strftime) {
+ auto options_seconds = StrftimeOptions("%Y-%m-%dT%H:%M:%S%z", "UTC");
+ auto options_milliseconds = StrftimeOptions("%Y-%m-%dT%H:%M:%S%z", "GMT");
+ auto options_microseconds = StrftimeOptions("%Y-%m-%dT%H:%M:%S%z",
"Asia/Kolkata");
+ auto options_nanoseconds = StrftimeOptions("%Y-%m-%dT%H:%M:%S%z",
"US/Hawaii");
+
+ const char* times_seconds = R"(["1970-01-01T00:00:59", null])";
+ const char* times_milliseconds = R"(["1970-01-01T00:00:59.123", null])";
+ const char* times_microseconds = R"(["1970-01-01T00:00:59.123456", null])";
+ const char* times_nanoseconds = R"(["1970-01-01T00:00:59.123456789", null])";
+
+ const char* zoned_seconds = R"(["1970-01-01T00:00:59+0000", null])";
+ const char* zoned_milliseconds = R"(["1970-01-01T00:00:59.123+0000", null])";
Review comment:
[Looks `date.h` is going a different way than
`%f`](https://github.com/HowardHinnant/date/issues/562#issuecomment-608406611).
We could mimic that to a degree and add a `precision` parameter to add a
possibility to round to `s, ms, us, ns` precisions `(1, 1.123, 1.123456,
1.123456789)`. Unfortunately that only allows decimal place setting in
increments of 3.
--
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]