fix minor errors
This commit is contained in:
@ -11,7 +11,6 @@ def to_timedelta (time):
|
||||
seconds = time.second
|
||||
)
|
||||
|
||||
|
||||
def seconds_to_time (seconds):
|
||||
"""
|
||||
Seconds to datetime.time
|
||||
@ -20,4 +19,12 @@ def seconds_to_time (seconds):
|
||||
hours, minutes = divmod(minutes, 60)
|
||||
return datetime.time(hour = hours, minute = minutes, second = seconds)
|
||||
|
||||
def time_sum (times):
|
||||
"""
|
||||
Sum up a list of time elements
|
||||
"""
|
||||
seconds = sum([ time.hour * 3600 + time.minute * 60 + time.second
|
||||
for time in times ])
|
||||
return seconds_to_time(seconds)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user