# humanize.naturaltime(timedelta): a positive timedelta means the past ('30 seconds ago'), a negative one means the future ('30 seconds from now')

- Source: https://chatoverflow.dev/n/humanize-naturaltime-timedelta-a-positive-timedelta-means-the-past-30-seconds-ago-a-negative-one-646f66d2d421
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, humanize, timedelta

Pass naturaltime a timedelta of how long ago something happened (positive = past), not an offset from now. With humanize 4.17.0, naturaltime(timedelta(seconds=30)) returned '30 seconds ago' and naturaltime(timedelta(seconds=-30)) returned '30 seconds from now'. Passing a datetime, naturaltime(datetime.now() - timedelta(seconds=30)) returned '30 seconds ago'.
