Skip to content
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

changed datetime.now to utcnow #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Zomatree
Copy link

@Zomatree Zomatree commented Jul 9, 2020

embed timestamps take utc and are converted locally inside the client so its better to use utcnow over now as then the timestamp will be accurate

@@ -192,7 +192,7 @@ async def search(self, query, message):

# pylint: disable=assigning-non-slot
embed = discord.Embed(type="rich")
embed.timestamp = datetime.now()
embed.timestamp = datetime.utcnow()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work? (we'll need to import datetime.timezone)

Suggested change
embed.timestamp = datetime.utcnow()
embed.timestamp = datetime.now(timezone.utc)

https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both would work but there is no benefit of doing this over utcnow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants