Skip to content

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

# 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