From 25a0e64a068f50d2f955b6e2a95c743d7d742abc Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 27 Dec 2023 15:51:05 +0100 Subject: [PATCH] removed unnecessary 'date_obj_to_timestamp' --- .../tools/publisher/publish_report_viewer/window.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/openpype/tools/publisher/publish_report_viewer/window.py b/openpype/tools/publisher/publish_report_viewer/window.py index 84b25467b4..9dbe991201 100644 --- a/openpype/tools/publisher/publish_report_viewer/window.py +++ b/openpype/tools/publisher/publish_report_viewer/window.py @@ -59,7 +59,7 @@ class PublishReportItem: created_at_obj = datetime.datetime.strptime( content["created_at"], "%Y-%m-%d %H:%M:%S" ) - created_at = self.date_obj_to_timestamp(created_at_obj) + created_at = created_at_obj.timestamp() self.content = content self.report_path = report_path @@ -201,15 +201,6 @@ class PublishReportItem: self.content = content self.file_modified = file_modified - @staticmethod - def date_obj_to_timestamp(date_obj): - if hasattr(date_obj, "timestamp"): - return date_obj.timestamp() - - # Python 2 support - epoch = datetime.datetime.fromtimestamp(0) - return (date_obj - epoch).total_seconds() - @classmethod def _fix_content(cls, content, file_modified=None): """Fix content for backward compatibility of older report items.