Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 9811225

Browse files
author
Samuel Hassine
committed
[client] Enhance datetime findings
1 parent f92d83f commit 9811225

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

pycti/utils/opencti_stix2.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,14 @@ def extract_embedded_relationships(self, stix_object, types=None) -> dict:
377377
try:
378378
if "description" in external_reference:
379379
matches = datefinder.find_dates(
380-
external_reference["description"]
380+
external_reference["description"],
381+
base_date=datetime.datetime.fromtimestamp(0),
381382
)
382383
else:
383-
matches = datefinder.find_dates(source_name)
384+
matches = datefinder.find_dates(
385+
source_name,
386+
base_date=datetime.datetime.fromtimestamp(0),
387+
)
384388
except:
385389
matches = None
386390
published = None
@@ -741,11 +745,13 @@ def import_relationship(self, stix_relation, update=False, types=None):
741745
try:
742746
if "description" in external_reference:
743747
matches = datefinder.find_dates(
744-
external_reference["description"]
748+
external_reference["description"],
749+
base_date=datetime.datetime.fromtimestamp(0),
745750
)
746751
else:
747752
matches = datefinder.find_dates(
748-
external_reference["source_name"]
753+
external_reference["source_name"],
754+
base_date=datetime.datetime.fromtimestamp(0),
749755
)
750756
except:
751757
matches = None

0 commit comments

Comments
 (0)