apoc.temporal.formatDuration

Function APOC Core

apoc.temporal.formatDuration(input, format) | Format a Duration

Signature

apoc.temporal.formatDuration(input :: ANY?, format :: STRING?) :: (STRING?)

Input parameters

Name Type Default

input

ANY?

null

format

STRING?

null

Usage Examples

This function formats durations using a list of built-in formats.

RETURN apoc.temporal.formatDuration(duration({seconds: 6000}), "hour") AS output;
Table 1. Results
output

"01"

RETURN apoc.temporal.formatDuration( duration({seconds: 10000}), "hour_minute") AS output;
Table 2. Results
output

"02:46"