Overview:
-
Negative time quantity in the context of an event that is to be started could mean the remaining time for that event to start. For example, if a meeting starts by 3.00 PM, at 2.58 PM a time duration of -2 minutes denotes the meeting is starting in 2 minutes.
- The attribute TimeDelta.min provides the biggest of such negative time quantity that can be represented using the TimeDelta class.
Example:
# Example Python program that prints from datetime import timedelta print(timedelta.min) # Try creating a timedelta smaller than timedelta.min |
Output:
Most negative timedelta: -999999999 days, 0:00:00 <class 'datetime.timedelta'> Traceback (most recent call last): File "/Valli/PythonProgs/td_ex1.py", line 12, in <module> print(timedelta(timedelta.min.days-1)) OverflowError: days=-1000000000; must have magnitude <= 999999999 |