humanize_seconds
Show seconds in human form.
For example, 60 becomes "1 minute", and 7200 becomes "2 hours".
def humanize_seconds(
secs: int,
prefix: str = '',
sep: str = '',
now: str = 'now',
microseconds: bool = false
) - > str
Show seconds in human form. For example, 60 becomes "1 minute", and 7200 becomes "2 hours".
Parameters
| Name | Type | Description |
|---|---|---|
| secs | int | The total number of seconds to be converted into a human-readable time duration. |
| prefix | str = '' | A preposition or string to prepend to the output, such as 'in' to produce 'in 1 second'. |
| sep | str = '' | A separator string inserted between the prefix and the time duration text. |
| now | str = 'now' | The literal string to return when the duration is zero seconds. |
| microseconds | bool = false | Whether to include microsecond precision in the output for durations less than one second. |
Returns
| Type | Description |
|---|---|
str | A human-readable string representing the duration, such as "2 hours" or the value of the 'now' parameter if the duration is zero. |