Skip to content
This repository was archived by the owner on Apr 30, 2026. It is now read-only.

change .utcnow() to .now(datetime.UTC) (deprecated)#801

Closed
MGMCN wants to merge 1 commit intosivel:masterfrom
MGMCN:deprecated-method-call-removed
Closed

change .utcnow() to .now(datetime.UTC) (deprecated)#801
MGMCN wants to merge 1 commit intosivel:masterfrom
MGMCN:deprecated-method-call-removed

Conversation

@MGMCN
Copy link
Copy Markdown

@MGMCN MGMCN commented Nov 18, 2023

When i run command speedtest-cli on my MacBook(Sonoma14.1.1) with Python3.12.

❯ speedtest-cli
Retrieving speedtest.net configuration...
/opt/homebrew/bin/speedtest-cli:960: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
  self.timestamp = '%sZ' % datetime.datetime.utcnow().isoformat()

This method will be deprecated in future versions of python-datetime and it is recommended to change it now. Thank you.

@MGMCN
Copy link
Copy Markdown
Author

MGMCN commented Nov 18, 2023

@sivel
I would appreciate it if you could review this small change.

@che-wf
Copy link
Copy Markdown

che-wf commented Jun 3, 2025

I think I would prefer PR #803 over this one.

@sivel sivel closed this Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants