Skip to main content

int_as_duration

Converts an integer representing a number of seconds into a human-readable duration string formatted as hours, minutes, and seconds.

def int_as_duration(
seconds: int
) - > string

Converts an integer representing a total number of seconds into a human-readable duration string in 'HH:MM:SS' format.

Parameters

NameTypeDescription
secondsintThe total number of seconds to be converted into a time duration format.

Returns

TypeDescription
stringA formatted string representing the duration, ensuring hours, minutes, and seconds are zero-padded to two digits.