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

send_image is sending images 5 hours into the past. #133

Closed
almafeta opened this issue Sep 2, 2023 · 0 comments · Fixed by #136
Closed

send_image is sending images 5 hours into the past. #133

almafeta opened this issue Sep 2, 2023 · 0 comments · Fixed by #136

Comments

@almafeta
Copy link

almafeta commented Sep 2, 2023

I am in Central Daylight Time, GMT-5. When calling send_image, it appears in my timeline 5 hours in the past.

send_image calls send_post. It looks like the cause for this bug is in send_post:

createdAt=datetime.now().isoformat(), text=text, reply=reply_to, embed=embed, langs=langs

in which it calls datetime.now().isoformat(). now() returns the local time zone; atproto uses UTC.

A fix would be to change line 2 to from datetime import datetime, timezone and line 120 to

createdAt=datetime.now(timezone.utc).isoformat(), text=text, reply=reply_to, embed=embed, langs=langs

It looks like like and repost have the same issue, but could be fixed similarly.

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 a pull request may close this issue.

1 participant