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

**URL:** <https://community.neo4j.com/t/using-temportal-format-to-format-a-duration-with-0-hours-returns-12-hours/17307>\
**Category:** Procedures & APOC\
**Tags:** apoc, operations\
**Created:** [April 18, 2020, 10:51pm UTC](https://community.neo4j.com/t/using-temportal-format-to-format-a-duration-with-0-hours-returns-12-hours/17307 "2020-04-18T22:51:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![es50678](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/es50678/32/9405_2.png) [@es50678](https://community.neo4j.com/u/es50678)\
**Post date:** [April 18, 2020, 10:51pm UTC](https://community.neo4j.com/t/using-temportal-format-to-format-a-duration-with-0-hours-returns-12-hours/17307/1 "2020-04-18T22:51:05Z")

</div>

Please keep the following things in mind:

did you [search](https://community.neo4j.com/search?expanded=true) for what you want to ask before posting?

- Yes

```auto
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')
=>"01:03:30"
# this also makes sense

RETURN apoc.temporal.format(duration("P0Y0M0W0DT13H3M30S"), 'hh:mm:ss')
=>"01:03:30"
# 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:  
[https://neo4j.com/docs/labs/apoc/current/temporal/temporal-conversions/](https://neo4j.com/docs/labs/apoc/current/temporal/temporal-conversions/)

[https://neo4j.com/docs/labs/apoc/current/temporal/datetime-conversions/](https://neo4j.com/docs/labs/apoc/current/temporal/datetime-conversions/)

> **[Temporal (Date/Time) values - Cypher Manual](https://neo4j.com/docs/cypher-manual/current/syntax/temporal/#cypher-temporal-durations)**
>
> Cypher has built-in support for handling temporal values, and the underlying database supports storing these temporal values as properties on nodes and relationships.

> **[Temporal functions - duration - Cypher Manual](https://neo4j.com/docs/cypher-manual/current/functions/temporal/duration/#functions-duration-create-string)**
>
> Cypher provides functions allowing for the creation and manipulation of values for a \_Duration\_ temporal type.

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

---

<div class="post-metadata">

**Author:** ![intouch\_vivek](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/intouch_vivek/32/4097_2.png) [@intouch\_vivek](https://community.neo4j.com/u/intouch_vivek)\
**Post date:** [April 19, 2020, 6:50pm UTC](https://community.neo4j.com/t/using-temportal-format-to-format-a-duration-with-0-hours-returns-12-hours/17307/2 "2020-04-19T18:50:10Z")

</div>

> [@es50678](#):
>
> RETURN apoc.temporal.format(duration("P0Y0M0W0DT13H3M30S"), 'hh:mm:ss')

Hi @es50678,

Hour is denoted as HH instead of hh.

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

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