-
Notifications
You must be signed in to change notification settings - Fork 168
Change utcnow to now(datetime.timezone.utc) #537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
mircealungu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small request @aknopper
aknopper
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made changes
|
|
||
| def get_date(p): | ||
| return datetime.utcfromtimestamp(int(request.args.get(p))) | ||
| return datetime.fromtimestamp(int(request.args.get(p)),tz = datetime.datetime.now(datetime.timezone.utc)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one small change: the tz=... expects a timezone object not a datetime. can you fix this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. no worries; i fixed it myself.
… we need to import timezone separately and use timezone.utc instead.
mircealungu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
-Found more instances of the deprecated utcnow function and changed to .now(datetime.UTC)