Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-18-2020 03:51 PM
Please keep the following things in mind:
did you search for what you want to ask before posting?
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/datetime-conversions/
https://neo4j.com/docs/cypher-manual/current/syntax/temporal/#cypher-temporal-durations
Maybe I keep overlooking something in these resources. If so, I would love for it to be pointed out to me.
04-19-2020 11:50 AM
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"
All the sessions of the conference are now available online