I'd like to compare two date times with an exact string output such as "3 hours, 2, minutes, 46 seconds". Now, say I have two datetime objects in UTC, I need them to be able to be an arbitrary amount but still cut off unneeded values. Example:
>>> import datetime
>>> date1 = datetime.datetime.now()
>>> date2 = datetime.datetime.fromtimestamp(123456789)
>>> date2 - date1
datetime.timedelta(-16362, 59566, 655021)
Now I could just use datetime.datetime.strftime()
as a follow up but with the wide range of values I can encounter (1 second to months) I want to cut off the unneeded values and avoid "0 months, 0 weeks... etc." and "1 hour, 0 minutes, 0 seconds" without rounding (values are always positive). Is there an effient way to dynamically do this to only show relevent time values? I've looked through other questions similar to How do I find the time difference between two datetime objects in python? but none fully answer my question and I cannot figure it out on my own after many hours of tinkering.