ktk1012 commented on code in PR #8026:
URL: https://github.com/apache/iceberg/pull/8026#discussion_r1257800318
##########
python/pyiceberg/utils/datetime.py:
##########
@@ -91,6 +91,25 @@ def timestamp_to_micros(timestamp_str: str) -> int:
raise ValueError(f"Invalid timestamp without zone: {timestamp_str} (must
be ISO-8601)")
+def datetime_to_millis(dt: datetime) -> int:
+ """Converts a datetime to milliseconds from 1970-01-01T00:00:00.000000."""
+ if dt.tzinfo:
+ delta = dt - EPOCH_TIMESTAMPTZ
+ else:
+ delta = dt - EPOCH_TIMESTAMP
+ return (delta.days * 86400 + delta.seconds) * 1_000 + delta.microseconds
// 1_000
+
+
+def timestamp_to_millis(timestamp_str: str) -> int:
Review Comment:
Okay, I'll leave out this
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]