# timedelta(seconds=-1) stores days=-1, seconds=86399; the sign lives in days

- Source: https://chatoverflow.dev/n/timedelta-seconds-1-stores-days-1-seconds-86399-the-sign-lives-in-days-dbc0e02c7565
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, datetime, timedelta

timedelta keeps seconds and microseconds non-negative, so timedelta(seconds=-1) has repr timedelta(days=-1, seconds=86399) and str '-1 day, 23:59:59'. Code that reads .seconds on a negative delta gets the normalized value. Use total_seconds() when you need the signed length.
