useConvertSecToMin
Converts a duration in seconds to a formatted string representation in minutes and seconds.
Parameters
Name | Description |
---|---|
secs | The duration in seconds to convert. |
format | The format to be converted. |
Returns
A formatted string representing the duration in minutes and seconds.
(secs: number, format: "Mm:Ss" | "mm:ss") => string
(secs: number, format: "Mm:Ss" | "mm:ss") => string
Examples
ts
useConvertSecToMin(135, 'Mm:Ss') // 2m 15s
useConvertSecToMin(135, 'mm:ss') // 02:15
useConvertSecToMin(120, 'Mm:Ss') // 2m
useConvertSecToMin(120, 'mm:ss') // 02:00
useConvertSecToMin(135, 'Mm:Ss') // 2m 15s
useConvertSecToMin(135, 'mm:ss') // 02:15
useConvertSecToMin(120, 'Mm:Ss') // 2m
useConvertSecToMin(120, 'mm:ss') // 02:00