[issue44663] Possible bug in datetime utc

2021-07-20 Thread Petr Viktorin
Change by Petr Viktorin : -- components: +Library (Lib) -C API ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue44663] Possible bug in datetime utc

2021-07-18 Thread Tim Peters
Tim Peters added the comment: If you want to pursue changing what utcnow() does, python-ideas or python-dev would probably need to be involved. Backward-incompatible changes are very hard sells. As Paul Ganssle noted here, https://blog.ganssle.io/articles/2019/11/utcnow.html in Python 2,

[issue44663] Possible bug in datetime utc

2021-07-18 Thread Paul Martin
Paul Martin added the comment: The difference between the two is the difference between your local time and utc. datetime.now(timezone.utc) This returns the current time in utc and is timezone aware. So the timestamp can figure out the seconds since epoch taking into account the timezone.

[issue44663] Possible bug in datetime utc

2021-07-17 Thread Vedran Čačić
Vedran Čačić added the comment: Would it be possible to change .utcnow to now return a datetime annotated with UTC "timezone"? After all, now we have timezone-aware datetimes and the convention that naive means local, this behavior might even be considered a bug. -- nosy: +veky

[issue44663] Possible bug in datetime utc

2021-07-17 Thread Tim Peters
Tim Peters added the comment: > It looks like the difference one would expect from (fast) human input) Nope, the timestamps in the original report are about 3 hours apart (10808+ seconds). Reports like these are often much clearer if they state the timezone of the system they're running

[issue44663] Possible bug in datetime utc

2021-07-17 Thread Henk-Jaap Wagenaar
Henk-Jaap Wagenaar added the comment: I don't seem to be able to reproduce this by running this one-liner: from datetime import datetime, timezone; print(datetime.now(timezone.utc).timestamp()); print(datetime.u tcnow().timestamp()); on 3.9.5. How did you achieve this? It looks like the

[issue44663] Possible bug in datetime utc

2021-07-17 Thread Gabriel Costa
New submission from Gabriel Costa : >>> datetime.now(timezone.utc).timestamp() 1626556067.054988 >>> datetime.utcnow().timestamp() 1626566875.174921 Should there be a difference between the two modes? -- components: C API messages: 397733 nosy: gabhcosta priority: normal severity: