Python timedelta issue with negative values
Hi I need some help to understand why this is happening. I have a method to track 'time remaining' in an event program: def get_program_time_budget(self): return self.estimated_duration-self.get_program_duration() All fine when the estimated_duration > self.get_program_duration() but when this goes the other way things get funny. Results are displayed to the user: Estimated 11 hours Allocated 10 hours 55 minutes Remaining 5 minutes When the result goes negative it does this: Estimated 11 hours Allocated 11 hours 5 minutes Remaining -1 day 23 hours 55 minutes Any ideas how to get the result -5