discord-timestamps generates properly-formatted dynamic timestamps for Discord messages, with support for Arrow objects.
>>> format_timestamp(datetime(2021, 11, 20, 12, 0, 0))
'<t:1637409600>'
>>> format_timestamp(datetime(...), TimestampType.RELATIVE)
'<t:1637409600:R>'
discord-timestamps is available on PyPI:
$ pip install discord-timestamps
discord-timestamps officially supports Python 3.6+.
See the wiki for discord-timestamps's documentation.