Skip to content

Commit

Permalink
Replace datetime.utcnow()
Browse files Browse the repository at this point in the history
  • Loading branch information
maresb committed Nov 6, 2024
1 parent 379df51 commit a71d2df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion conda_lock/conda_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,9 @@ def do_render(
"dev-dependencies": str(include_dev_dependencies).lower(),
"input-hash": lockfile.metadata.content_hash,
"version": distribution("conda_lock").version,
"timestamp": datetime.datetime.utcnow().strftime("%Y%m%dT%H%M%SZ"),
"timestamp": datetime.datetime.now(datetime.timezone.utc).strftime(
"%Y%m%dT%H%M%SZ"
),
}

filename = filename_template.format(**context)
Expand Down
4 changes: 3 additions & 1 deletion conda_lock/lockfile/v1/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ class TimeMeta(StrictModel):
@classmethod
def create(cls) -> "TimeMeta":
return cls(
created_at=datetime.datetime.utcnow().isoformat(timespec="seconds") + "Z"
created_at=datetime.datetime.now(datetime.timezone.utc).strftime(
"%Y-%m-%dT%H:%M:%SZ"
)
)


Expand Down

0 comments on commit a71d2df

Please sign in to comment.