From 7e9bbfc805eded3cbb283304f8202b4640aae816 Mon Sep 17 00:00:00 2001 From: mwander Date: Sun, 6 Jun 2021 19:04:45 +0200 Subject: [PATCH] Revert "convert unixtime into UTC datetime" This reverts commit 9dab931f44c021657e053296b5691ed98f9693c6. 9dab93 fixes Elastic output, but breaks Splunk output. See 4ad693 for a better fix. --- parsedmarc/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parsedmarc/utils.py b/parsedmarc/utils.py index 177a880..dbf525f 100644 --- a/parsedmarc/utils.py +++ b/parsedmarc/utils.py @@ -201,15 +201,15 @@ def get_reverse_dns(ip_address, cache=None, nameservers=None, timeout=2.0): def timestamp_to_datetime(timestamp): """ - Converts a UNIX/DMARC timestamp to a Python ``DateTime`` object (UTC) + Converts a UNIX/DMARC timestamp to a Python ``DateTime`` object Args: timestamp (int): The timestamp Returns: - DateTime: The converted timestamp as a Python ``DateTime`` object (UTC) + DateTime: The converted timestamp as a Python ``DateTime`` object """ - return datetime.utcfromtimestamp(int(timestamp)) + return datetime.fromtimestamp(int(timestamp)) def timestamp_to_human(timestamp): @@ -220,7 +220,7 @@ def timestamp_to_human(timestamp): timestamp: The timestamp Returns: - str: The converted timestamp in ``YYYY-MM-DD HH:MM:SS`` format (UTC) + str: The converted timestamp in ``YYYY-MM-DD HH:MM:SS`` format """ return timestamp_to_datetime(timestamp).strftime("%Y-%m-%d %H:%M:%S")