speedtest-cli icon indicating copy to clipboard operation
speedtest-cli copied to clipboard

Use timezone-aware datetime.datetime.now()

Open 4n3w opened this issue 1 year ago • 6 comments

Replace deprecated datetime.datetime.utcnow() with timezone-aware datetime.datetime.now()

This change addresses a deprecation warning for python 3.12 by using datetime.datetime.now() with datetime.timezone.utc, ensuring the timestamp remains in UTC and conforms to newer best practices.

4n3w avatar Apr 12 '24 21:04 4n3w

Works for me too

➜  ~ curl https://raw.githubusercontent.com/4n3w/speedtest-cli/fix_datetime_utcnow_deprecation/speedtest.py | python3 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 65352  100 65352    0     0   263k      0 --:--:-- --:--:-- --:--:--  263k
Retrieving speedtest.net configuration...
Testing from Spectrum (a.b.c.d)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Airlink Internet Inc (Los Angeles, CA) [167.30 km]: 20.176 ms
Testing download speed................................................................................
Download: 196.26 Mbit/s
Testing upload speed......................................................................................................
Upload: 10.62 Mbit/s

senderic avatar Aug 10 '24 21:08 senderic

I guess someone with write access would have to merge this, summoning @sivel

4n3w avatar Aug 19 '24 13:08 4n3w

image

you should update that too

SantiiRepair avatar Sep 13 '24 15:09 SantiiRepair

duplicate of #801 (and would be included in #799 also)?

ckujau avatar Sep 20 '24 22:09 ckujau

hey guys, just FYI this is still a thing:

image

teddy931130 avatar Feb 08 '25 07:02 teddy931130

Really?

On Sat, 8 Feb 2025, 3:22 am Teodor Daskalov, @.***> wrote:

hey guys, just FYI this is still a thing: image.png (view on web) https://github.com/user-attachments/assets/04399604-3804-4e85-961f-6c402c32075d

— Reply to this email directly, view it on GitHub https://github.com/sivel/speedtest-cli/pull/805#issuecomment-2644559952, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWTMNNRM7WUC3ZQ4JYBM3O32OWWB3AVCNFSM6AAAAABGE2F4MGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNBUGU2TSOJVGI . You are receiving this because you commented.Message ID: @.***>

SantiiRepair avatar Feb 08 '25 11:02 SantiiRepair