Skip to content

Commit aa5a14c

Browse files
committed
review suggestions
1 parent 935e5a7 commit aa5a14c

File tree

2 files changed

+22
-41
lines changed

2 files changed

+22
-41
lines changed

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

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -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
----
8664
WITH 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"
9674
1+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
----
11088
WITH 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"
12098
1+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
----
154132
WITH 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"
164142
1+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
----
178156
WITH 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"
188166
1+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
274252
RETURN 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
295274
RETURN 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"
326305
2+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

modules/ROOT/pages/values-and-types/temporal.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,16 +1761,16 @@ Using Cypher's xref:/functions/temporal/format.adoc#_instance_types[`format()` f
17611761
[source, cypher, indent=0]
17621762
----
17631763
WITH datetime('1986-11-18T6:04:45.123456789+01:00[Europe/Berlin]') AS dt
1764-
RETURN format(dt, "yyyy-MM-dd'T'HH:mm:ss.SSSZ") AS x
1764+
RETURN format(dt, "MM/dd/yyyy") AS EU, format(dt, "dd/MM/yyyy") AS US
17651765
----
17661766
17671767
.Result
1768-
[role="queryresult",options="header,footer",cols="1*<m"]
1768+
[role="queryresult",options="header,footer",cols="2*<m"]
17691769
|===
17701770
1771-
| x
1772-
| "1986-11-18T06:04:45.123+0100"
1773-
1+d|Rows: 1
1771+
| EU | US
1772+
| "11/18/1986" | "18/11/1986"
1773+
2+d|Rows: 1
17741774
17751775
|===
17761776

0 commit comments

Comments
 (0)