From 991c3ecfe0b2a31f97dae81b324c230a323c89d9 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Thu, 29 Oct 2026 10:04:29 +0000 Subject: [PATCH] ref(utils): Remove unused to_timestamp helper and epoch constant The last callers of to_timestamp were removed with the old metrics code in #4899. epoch was only used by to_timestamp. --- sentry_sdk/utils.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sentry_sdk/utils.py b/sentry_sdk/utils.py index eeee118ed7..b9be3d8936 100644 --- a/sentry_sdk/utils.py +++ b/sentry_sdk/utils.py @@ -79,8 +79,6 @@ R = TypeVar("R") -epoch = datetime(1970, 1, 1) - # The logger is created here but initialized in the debug support module logger = logging.getLogger("sentry_sdk.errors") @@ -248,10 +246,6 @@ def capture_internal_exception(exc_info: "ExcInfo") -> None: logger.error("Internal error in sentry_sdk", exc_info=exc_info) -def to_timestamp(value: "datetime") -> float: - return (value - epoch).total_seconds() - - def format_timestamp(value: "datetime") -> str: """Formats a timestamp in RFC 3339 format.