This PR fixes non-timezone aware timestamps. In dpy 1.x, timestamps are not timezone aware. When we convert the timestamp to a Discord timestamp, the timestamp is in the local timezone, but Discord expects it in UTC. We should convert the time object to UTC first, and then convert it to a UNIX timestamp.
In dpy 2.x, timestamps from discord objects are now timezone aware, so this should be a no-op (that being said, I have not tried with dpy2 yet).
I replaced the datetime arg with ts instead in order to avoid collision with the datetime module while accessing timezone.
This PR fixes non-timezone aware timestamps. In dpy 1.x, timestamps are not timezone aware. When we convert the timestamp to a Discord timestamp, the timestamp is in the local timezone, but Discord expects it in UTC. We should convert the time object to UTC first, and then convert it to a UNIX timestamp.
In dpy 2.x, timestamps from
discord
objects are now timezone aware, so this should be a no-op (that being said, I have not tried with dpy2 yet).I replaced the
datetime
arg withts
instead in order to avoid collision with thedatetime
module while accessingtimezone
.Before (my timezone is GMT-7 Pacific):
After: