The point made by @Lonami is valid - offset_date
is used to get messages prior to that date. However, the docs describe another argument called reverse
that you can supply to iter_messages
:
reverse (bool, optional):
If set to True, the messages will be returned in reverse order (from oldest to newest, instead of the default newest to oldest). This also means that the meaning of offset_id and offset_date parameters is reversed, although they will still be exclusive.
So, if you use it like this:
for message in client.iter_messages(chat, reverse = True, offset_date = date_of_post):
print(message.sender_id, ':', message.text)
it should work as you expected.