Skip to content

Room history latest argument does not handle timezones #53

@makew0rld

Description

@makew0rld

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions