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

Room history latest argument does not handle timezones #53

Open
makew0rld opened this issue Sep 9, 2020 · 0 comments
Open

Room history latest argument does not handle timezones #53

makew0rld opened this issue Sep 9, 2020 · 0 comments

Comments

@makew0rld
Copy link

Bug

When I do get_room_history("someid", latest=datetime.datetime.now()), I get the messages from many hours ago, as if those were the most recent.

I am in the UTC-4 timezone, and using .now() results in me getting the messages from 4 hours ago as if they were the most recent. I am guessing this is because Rocket Chat returns UTC timestamps, but .now() returns a local timestamp. It would be helpful if rocket-python did the conversion.

User Solutions

The easiest solution is to set latest like so: latest=datetime.datetime.utcnow(). If I don't want the current time I can put in other timestamps, but they should still be in UTC.

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

No branches or pull requests

1 participant