Resolve datetime.utcfromtimestamp deprecation (#4719)

This commit is contained in:
Emmanuel Ferdman
2025-05-19 19:05:07 +03:00
committed by GitHub
parent f2f9cdac66
commit 2ad2d68c4a
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ import shutil
import subprocess
import zipfile
from dataclasses import is_dataclass, astuple
from datetime import datetime, date
from datetime import datetime, date, timezone
from pathlib import Path
from typing import Dict, Union, Optional, Callable
from string import Template
@@ -303,7 +303,7 @@ def unix_time_to_formatted(timestamp): # type: (int|str) -> str
if timestamp > 2 ** 32:
timestamp = round(timestamp / 1000, 3)
return datetime.utcfromtimestamp(timestamp).strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3] + 'Z'
return datetime.fromtimestamp(timestamp, timezone.utc).strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3] + 'Z'
def normalize_timing_and_sort(events, timestamp='@timestamp', asc=True):
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "detection_rules"
version = "1.2.5"
version = "1.2.6"
description = "Detection Rules is the home for rules used by Elastic Security. This repository is used for the development, maintenance, testing, validation, and release of rules for Elastic Securitys Detection Engine."
readme = "README.md"
requires-python = ">=3.12"