You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/07/22 13:21:00 UTC

[GitHub] [iceberg] dimas-b commented on a diff in pull request #5337: Core: Print DateTime strings always with +00:00 Zone offset

dimas-b commented on code in PR #5337:
URL: https://github.com/apache/iceberg/pull/5337#discussion_r927645626


##########
core/src/main/java/org/apache/iceberg/util/DateTimeUtil.java:
##########
@@ -86,6 +83,10 @@ public static long microsFromTimestamptz(OffsetDateTime dateTime) {
   }
 
   public static String formatTimestampMillis(long millis) {
-    return DATE_FORMAT.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(millis), ZoneOffset.UTC));
+    return Instant.ofEpochMilli(millis)
+        .atOffset(ZoneOffset.UTC)
+        .toZonedDateTime()
+        .toString()
+        .replace("Z", "+00:00");

Review Comment:
   Why not keep `Z`? It's a standard designation for UTC, I think :thinking: 



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org