Convert enclosure Duration from unix to humane readable time

i want to convert enclosure duration that i have in length

<enclosure length="70588566" type="audio/mpeg" url="" /> 

to something like that , duration 48:41

i have duration in params like that :
duration: 70588566

i have tried this but it didn’t work:

 {{ $duration := .Params.duration }}
 {{ time.ParseDuration   $duration  }}

all go time functions:

thanks for your reply, i have looked into that and i can’t find a way to make it work :frowning:

See Hugo doc: and

:sweat_smile: i’ve seen that before posting here, the thing is that i have tried all what i have seen there and nothing seem to make it work , i’m new to Go so yeah!

Enclosure 'length' is measured in bytes, not time.


ParseDuration parses a duration string (e.g. “30s”), which is the opposite of what you want


{{ 70588566 | time.Duration "ms" }}
Unit is one of nanosecond/ns, microsecond/us/µs, millisecond/ms, second/s, minute/m or hour/h.

@regis Duration and ParseDuration does not come up when searching from them in the docs site … hint …