|
|
|
|
|
by Aramgutang
1340 days ago
|
|
I was familiar with the issue described, but it was useful to learn the shortcut of passing a timezone to `now()`, since I used to rely on `utcnow().replace()`, which was needlessly verbose. # what I used to do:
>>> datetime.utcnow().replace(tzinfo=timezone.utc)
# what I'll be doing from now on:
>>> datetime.now(timezone.utc)
|
|