@@ -33,28 +33,6 @@ Use the characters in xref:#query-functions-temporal-format-instance-types-chara
3333[[query-functions-temporal-format-instance-types-examples]]
3434=== Examples
3535
36- .Instance formatting with year, month, day, hour, minute, second, fraction-of-second and zone-offset
37- ======
38-
39- .Query
40- [source, cypher, indent=0]
41- ----
42- WITH datetime('1986-11-18T6:04:45.123456789+01:00[Europe/Berlin]') AS dt
43- RETURN format(dt, "yyyy-MM-dd'T'HH:mm:ss.SSSZ") AS x
44- ----
45-
46- .Result
47- [role="queryresult",options="header,footer",cols="1*<m"]
48- |===
49-
50- | x
51- | "1986-11-18T06:04:45.123+0100"
52- 1+d|Rows: 1
53-
54- |===
55-
56- ======
57-
5836.Instance formatting, European and US American dates
5937======
6038
@@ -84,14 +62,14 @@ RETURN format(dt, "MM/dd/yyyy") AS EU, format(dt, "dd/MM/yyyy") AS US
8462[source, cypher, indent=0]
8563----
8664WITH datetime('1986-11-18T6:04:45.123456789+01:00[Europe/Berlin]') AS dt
87- RETURN format(dt, "EEEE, MMMM d, G uuuu") AS x
65+ RETURN format(dt, "EEEE, MMMM d, G uuuu") AS instanceString
8866----
8967
9068.Result
9169[role="queryresult",options="header,footer",cols="1*<m"]
9270|===
9371
94- | x
72+ | instanceString
9573| "Tuesday, November 18, AD 1986"
96741+d|Rows: 1
9775
@@ -108,14 +86,14 @@ Four occurrences of `E` and `M` (text presentations) output the full form of the
10886[source, cypher, indent=0]
10987----
11088WITH datetime('1986-11-18T6:04:45.123456789+01:00[Europe/Berlin]') AS dt
111- RETURN format(dt, "DDD'th day of the year,' c'rd day of the week'") AS x
89+ RETURN format(dt, "DDD'th day of the year,' c'rd day of the week'") AS instanceString
11290----
11391
11492.Result
11593[role="queryresult",options="header,footer",cols="1*<m"]
11694|===
11795
118- | x
96+ | instanceString
11997| "322th day of the year, 3rd day of the week"
120981+d|Rows: 1
12199
@@ -152,14 +130,14 @@ RETURN format(dt, "k:mm z") AS CET, format(dt, "K:mm O") AS GMT
152130[source, cypher, indent=0]
153131----
154132WITH datetime('1986-11-18T6:04:45.123456789+01:00[Europe/Berlin]') AS dt
155- RETURN format(dt, "LLL d,' minute 'm', second 's', millisecond of the day 'A") AS x
133+ RETURN format(dt, "LLL d,' minute 'm', second 's', millisecond of the day 'A") AS instanceString
156134----
157135
158136.Result
159137[role="queryresult",options="header,footer",cols="1*<m"]
160138|===
161139
162- | x
140+ | instanceString
163141| "Nov 18, minute 4, second 45, millisecond of the day 21885123"
1641421+d|Rows: 1
165143
@@ -176,14 +154,14 @@ Three occurrences of `L` (number/text presentation) output the short form ("Nov"
176154[source, cypher, indent=0]
177155----
178156WITH datetime('1986-11-18T6:04:45.123456789+01:00[Europe/Berlin]') AS dt
179- RETURN format(dt, "pppYY") AS x
157+ RETURN format(dt, "pppYY") AS instanceString
180158----
181159
182160.Result
183161[role="queryresult",options="header,footer",cols="1*<m"]
184162|===
185163
186- | x
164+ | instanceString
187165| " 86"
1881661+d|Rows: 1
189167
@@ -270,8 +248,9 @@ For example, not all months have the same number of days, and switches to or fro
270248.Query
271249[source, cypher, indent=0]
272250----
273- WITH duration({years: 1, months: 4, weeks: 3, days: 4, hours: 5, minutes: 6, seconds: 7, milliseconds: 8, microseconds: 9, nanoseconds: 10 }) AS d
251+ WITH duration({years: 1, months: 4}) AS d
274252RETURN format(d, "y 'years' q 'quarters' M 'months'") AS withYears, format(d, "q 'quarters' M 'months'") AS withoutYears
253+
275254----
276255
277256.Result
@@ -291,7 +270,7 @@ RETURN format(d, "y 'years' q 'quarters' M 'months'") AS withYears, format(d, "q
291270.Query
292271[source, cypher, indent=0]
293272----
294- WITH duration({years: 1, months: 4, weeks: 3, days: 4, hours: 5, minutes: 6, seconds: 7, milliseconds: 8, microseconds: 9, nanoseconds: 10 }) AS d
273+ WITH duration({weeks: 3, days: 4}) AS d
295274RETURN format(d, "w 'weeks' d 'days'") AS withWeeks, format(d, "d 'days'") AS withoutWeeks
296275----
297276
@@ -313,20 +292,22 @@ RETURN format(d, "w 'weeks' d 'days'") AS withWeeks, format(d, "d 'days'") AS wi
313292.Query
314293[source, cypher, indent=0]
315294----
316- WITH duration({years: 1, months: 4, weeks: 3, days: 4, hours: 5, minutes: 6, seconds: 7, milliseconds: 8, microseconds: 9, nanoseconds: 10 }) AS d
317- RETURN format(d, "m 'minutes' s 'seconds' N 'nanos' ") AS withMinutes, format(d, "s 'seconds' N 'nanos '") AS withoutMinutes
295+ WITH duration({days: 4, hours: 5, minutes: 6, seconds: 7}) AS d
296+ RETURN format(d, "m 'minutes' s 'seconds'") AS withMinutes, format(d, "s 'seconds'") AS withoutMinutes
318297----
319298
320299.Result
321300[role="queryresult",options="header,footer",cols="2*<m"]
322301|===
323302
324- | withMinutes | withoutMinutes
325- | "306 minutes 7 seconds 8009010 nanos " | "18367 seconds 8009010 nanos "
303+ | withMinutes | withoutMinutes
304+ | "306 minutes 7 seconds" | "18367 seconds"
3263052+d|Rows: 1
327306
328307|===
329308
309+ Not how the days cannot be converted to hours and do not affect the query result.
310+
330311======
331312
332313
0 commit comments