From 6305673729825f386d2dbc4cfb455776111b368a Mon Sep 17 00:00:00 2001 From: burnettk Date: Tue, 30 Jul 2024 14:25:28 -0400 Subject: [PATCH] scrap pytz --- event-stream/elasticsearch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/event-stream/elasticsearch.py b/event-stream/elasticsearch.py index 35d85ab8f..96b460ed5 100644 --- a/event-stream/elasticsearch.py +++ b/event-stream/elasticsearch.py @@ -1,5 +1,5 @@ from datetime import datetime -import pytz +from datetime import timezone import json import os, os.path import socket @@ -48,7 +48,7 @@ def send_event(event): timestamp_value = event['timestamp'] # if timestamp is an integer or a float (any numeric type), convert to a iso8601 string so that elastic will index it as a date if isinstance(timestamp_value, (int, float)): - utc_time = datetime.fromtimestamp(timestamp_value, tz=pytz.UTC) + utc_time = datetime.fromtimestamp(timestamp_value, tz=timezone.utc) event['timestamp'] = utc_time.isoformat() try: