jorisvandenbossche commented on code in PR #39272:
URL: https://github.com/apache/arrow/pull/39272#discussion_r1432426148


##########
cpp/src/arrow/util/formatting_util_test.cc:
##########
@@ -522,6 +522,50 @@ TEST(Formatting, Timestamp) {
     AssertFormatting(formatter, -2203932304LL * 1000000000LL + 8,
                      "1900-02-28 12:34:56.000000008");
   }
+
+  {
+    auto timestamp_types = {timestamp(TimeUnit::SECOND, "US/Eastern"),
+                            timestamp(TimeUnit::SECOND, "+01:00"),
+                            timestamp(TimeUnit::SECOND, 
"Mars/Mariner_Valley")};
+    for (auto ty : timestamp_types) {
+      StringFormatter<TimestampType> formatter(ty.get());
+
+      AssertFormatting(formatter, 0, "1970-01-01 00:00:00Z");
+    }
+  }
+
+  {
+    auto timestamp_types = {timestamp(TimeUnit::MILLI, "US/Eastern"),
+                            timestamp(TimeUnit::MILLI, "Pacific/Maruesas"),
+                            timestamp(TimeUnit::MILLI, "Mars/Mariner_Valley")};
+    for (auto ty : timestamp_types) {
+      StringFormatter<TimestampType> formatter(ty.get());
+
+      AssertFormatting(formatter, 0, "1970-01-01 00:00:00.000Z");
+    }
+  }

Review Comment:
   Personally, I don't think it is necessary to test multiple timezones for the 
other resolutions (there is nothing in the code that currently is tz-dependent, 
and it would still be caught by the 3 different timezones tested above for 
SECOND resolution). I would simplify this to just test a single one.



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