Skip to content

Commit 9bd81c1

Browse files
authored
Make timestamps actually ISO with timezones, as per spec
1 parent d16f2d0 commit 9bd81c1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

wfcommons/common/workflow.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,12 @@ def __init__(self,
5555
"""Create an object of a workflow representation."""
5656
self.description: Optional[
5757
str] = description if description else "Instance generated with WfCommons - https://wfcommons.org"
58-
self.created_at: str = str(datetime.utcnow().isoformat())
58+
self.created_at: str = str(datetime.now().astimezone().isoformat())
5959
self.schema_version: str = "1.4"
6060
self.wms_name: Optional[str] = "WfCommons" if not wms_name else wms_name
6161
self.wms_version: Optional[str] = str(__version__) if not wms_version else wms_version
6262
self.wms_url: Optional[str] = f"https://docs.wfcommons.org/en/v{__version__}/" if not wms_url else wms_url
63-
self.executed_at: Optional[str] = datetime.now().astimezone().strftime(
64-
"%Y%m%dT%H%M%S%z") if not executed_at else executed_at
63+
self.executed_at: Optional[str] = datetime.now().astimezone().isoformat()) if not executed_at else executed_at
6564
self.makespan: Optional[int] = makespan
6665
self.tasks = {}
6766
self.tasks_parents = {}

0 commit comments

Comments
 (0)