Skip to main content

float_as_duration

No overview available.

def float_as_duration(
seconds: float
) - > string

Converts a floating-point number representing seconds into a human-readable duration string in 'HH:MM:SS' format. This is useful for displaying elapsed time or media playback lengths where sub-second precision is not required.

Parameters

NameTypeDescription
secondsfloatThe total number of seconds to be converted into a formatted duration string.

Returns

TypeDescription
stringA formatted string representing the duration in hours, minutes, and seconds (e.g., '01:05:20').