convert_to_secs

lib.utils.convert_to_secs(*args: int | str) int

Convert time in hours, minutes, and seconds to seconds.

Parameters:

*args (int | str) – 1, 2 or 3 ints. If 2 ints are supplied, then (minutes, seconds) is implied. If 3 ints are supplied then (hours, minutes, seconds) is implied.

Returns:

The given time converted to seconds

Return type:

int

Example

>>> from lib.utils import convert_to_secs
>>> convert_to_secs(1, 30, 0)
5400
>>> convert_to_secs(0, 15, 30)
930
>>> convert_to_secs(0, 0, 45)
45