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

Commit b50785d

Browse files
author
Samuel Hassine
committed
[client] Fix dates
1 parent da5d669 commit b50785d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pycti/utils/opencti_stix2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def extract_embedded_relationships(self, stix_object, types=None) -> dict:
391391
for match in matches:
392392
if (
393393
match.timestamp() < yesterday.timestamp()
394-
and len(match.year) == 4
394+
and len(str(match.year)) == 4
395395
):
396396
published = match.strftime("%Y-%m-%dT%H:%M:%SZ")
397397
break
@@ -752,7 +752,7 @@ def import_relationship(self, stix_relation, update=False, types=None):
752752
for match in matches:
753753
if (
754754
match.timestamp() < yesterday.timestamp()
755-
and len(match.year) == 4
755+
and len(str(match.year)) == 4
756756
):
757757
date = match.strftime("%Y-%m-%dT%H:%M:%SZ")
758758
break

0 commit comments

Comments
 (0)