Skip to content

Commit 027ae6a

Browse files
committed
Remove usage of deprecated datetime API
1 parent 30878f4 commit 027ae6a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

flux/current_timeline.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ def now(cls):
3030
@classmethod
3131
def utcnow(cls):
3232
if not _current.is_modified():
33-
return _datetime.datetime.utcnow()
34-
return _datetime.datetime.utcfromtimestamp(time())
33+
return _datetime.datetime.now(_datetime.timezone.utc)
34+
return _datetime.datetime.fromtimestamp(time(), _datetime.timezone.utc)
35+
3536

3637
class date(_datetime.date):
3738
@classmethod

0 commit comments

Comments
 (0)