Using temportal.format to format a duration with 0 hours returns 12 hours

Please keep the following things in mind:

did you search for what you want to ask before posting?

  • Yes
RETURN apoc.temporal.format(duration("P0Y0M0W0DT0H3M30S"), 'hh:mm:ss');
=> "12:03:30"
# I would expect the return value to be 0:03:30

RETURN apoc.temporal.format(duration("P0Y0M0W0DT12H3M30S"), 'hh:mm:ss')
=> "12:03:30"
# this makes sense to me

RETURN apoc.temporal.format(duration("P0Y0M0W0DT1H3M30S"), 'hh:mm:ss')
# this also makes sense

RETURN apoc.temporal.format(duration("P0Y0M0W0DT13H3M30S"), 'hh:mm:ss')
# this throws me off again.

It's pretty clear that I'm misunderstanding something about either how durations work or how the format function works. I'm just looking for resources on where to learn this information.

I've read through the following resources:

Maybe I keep overlooking something in these resources. If so, I would love for it to be pointed out to me.

Hi @es50678,

Hour is denoted as HH instead of hh.

"apoc.temporal.format(duration("P0Y0M0W0DT0H3M30S"), 'HH:mm:ss')"

"apoc.temporal.format(duration("P0Y0M0W0DT13H3M30S"), 'HH:mm:ss')"