Skip to content

Commit b9ad57a

Browse files
committed
clarification for duration conversions
1 parent 81a5bf5 commit b9ad57a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

modules/ROOT/pages/functions/temporal/format.adoc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,6 @@ The three occurrences of `p` add one space character of padding to the two digit
381381
[[query-functions-temporal-format-duration-types]]
382382
=== Duration types
383383

384-
Cypher's duration type `DURATION` has components and component groups, see xref:values-and-types/temporal.adoc#cypher-temporal-accessing-components-durations[components of durations].
385-
386-
When constructing a string representation of a duration type with `format()`, components can only be converted within the component groups, for example, weeks to days since they are both in the component group "Days".
387-
This is because without a reference point, there is no way of determining the specifics of a duration.
388-
For example, not all months have the same number of days, and switches to or from daylight saving time means that a day has 23 or 25 hours rather than 24.
389-
390384
Use the characters in table <<duration-character-table>> to create a string pattern for duration types.
391385

392386
[#duration-character-table]
@@ -407,6 +401,11 @@ Use the characters in table <<duration-character-table>> to create a string patt
407401
| | N | nanoseconds
408402
|===
409403

404+
Cypher's duration type `DURATION` has components and component groups, see xref:values-and-types/temporal.adoc#cypher-temporal-accessing-components-durations[components of durations].
405+
If the string pattern contains a character from a component group but does not contain a character denoting a longer duration from the same group, `format()` converts the longer duration to the equivalent duration with the character that is present, for example a missing `y` (year) will be converted to four quarters, if `q` is present in the string pattern.
406+
This is because without a reference point, there is no way of determining the specifics of a duration.
407+
For example, not all months have the same number of days, and switches to or from daylight saving time means that a day has 23 or 25 hours rather than 24.
408+
410409
.Duration formatting
411410
======
412411

0 commit comments

Comments
 (0)