Skip to content

Commit 685d152

Browse files
second
1 parent 2542390 commit 685d152

File tree

1 file changed

+29
-22
lines changed

1 file changed

+29
-22
lines changed

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

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ RETURN theDate
482482
======
483483
484484
.Query
485-
// tag::functions_temporal_date_transaction[]
486485
[source, cypher]
487486
----
488487
UNWIND [
@@ -492,7 +491,6 @@ date({year: 1984})
492491
] AS theDate
493492
RETURN theDate
494493
----
495-
// end::functions_temporal_date_transaction[]
496494
497495
.Result
498496
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -569,7 +567,6 @@ The date corresponding to `11 February 1984` is returned.
569567
======
570568
571569
.Query
572-
// tag::functions_temporal_date_statement[]
573570
[source, cypher]
574571
----
575572
UNWIND [
@@ -579,7 +576,6 @@ datetime({year: 1984, month: 11, day: 11, hour: 12, timezone: '+01:00'})
579576
] AS dd
580577
RETURN date({date: dd}) AS dateOnly, date({date: dd, day: 28}) AS dateDay
581578
----
582-
// end::functions_temporal_date_statement[]
583579
584580
.Result
585581
[role="queryresult",options="header,footer",cols="2*<m"]
@@ -709,10 +705,12 @@ However, a different value may be produced for different statements within the s
709705
======
710706
711707
.Query
708+
// tag::functions_temporal_date_statement[]
712709
[source, cypher]
713710
----
714711
RETURN date.statement() AS currentDate
715712
----
713+
// tag::functions_temporal_date_statement[]
716714
717715
.Result
718716
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -745,10 +743,13 @@ However, a different value may be produced for different transactions.
745743
======
746744
747745
.Query
746+
// tag::functions_temporal_date_transaction[]
748747
[source, cypher]
749748
----
750749
RETURN date.transaction() AS currentDate
751750
----
751+
// end::functions_temporal_date_transaction[]
752+
752753
753754
.Result
754755
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -800,6 +801,7 @@ For example, `day` -- with some value `x` -- may be provided when the truncation
800801
======
801802
802803
.Query
804+
// tag::functions_temporal_date_truncate[]
803805
[source, cypher]
804806
----
805807
WITH
@@ -819,6 +821,8 @@ RETURN
819821
date.truncate('week', d, {dayOfWeek: 2}) AS truncWeek,
820822
date.truncate('day', d) AS truncDay
821823
----
824+
// tag::functions_temporal_date_truncate[]
825+
822826
823827
.Result
824828
[role="queryresult",options="header,footer",cols="9*<m"]
@@ -917,10 +921,12 @@ RETURN
917921
======
918922
919923
.Query
924+
// tag::functions_temporal_datetime[]
920925
[source, cypher]
921926
----
922927
RETURN datetime() AS currentDateTime
923928
----
929+
// end::functions_temporal_datetime[]
924930
925931
The current date and time using the local timezone is returned.
926932
@@ -1232,7 +1238,6 @@ RETURN
12321238
The following query shows the various usages of `+datetime({datetime [, year, ..., timezone]})+`.
12331239
12341240
.Query
1235-
// tag::functions_temporal_datetime[]
12361241
[source, cypher]
12371242
----
12381243
WITH
@@ -1247,7 +1252,6 @@ RETURN
12471252
datetime({datetime: dd, day: 28, second: 42}) AS dateTimeDDSS,
12481253
datetime({datetime: dd, day: 28, second: 42, timezone: 'Pacific/Honolulu'}) AS dateTimeDDSSTimezone
12491254
----
1250-
// end::functions_temporal_datetime[]
12511255
12521256
.Result
12531257
[role="queryresult",options="header,footer",cols="4*<m"]
@@ -1663,12 +1667,10 @@ RETURN
16631667
======
16641668
16651669
.Query
1666-
// tag::functions_temporal_localtime[]
16671670
[source, cypher]
16681671
----
16691672
RETURN localdatetime() AS now
16701673
----
1671-
// end::functions_temporal_localtime[]
16721674
16731675
The current local date and time (i.e. in the local timezone) is returned.
16741676
@@ -1715,7 +1717,6 @@ The current local date and time in California is returned.
17151717
======
17161718
17171719
.Query
1718-
// tag::functions_temporal_localtime_transaction[]
17191720
[source, cypher]
17201721
----
17211722
RETURN
@@ -1724,7 +1725,6 @@ RETURN
17241725
hour: 12, minute: 31, second: 14, millisecond: 123, microsecond: 456, nanosecond: 789
17251726
}) AS theDate
17261727
----
1727-
// end::functions_temporal_localtime_transaction[]
17281728
17291729
.Result
17301730
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -1768,7 +1768,6 @@ RETURN
17681768
======
17691769
17701770
.Query
1771-
// tag::functions_temporal_localtime_statement[]
17721771
[source, cypher]
17731772
----
17741773
RETURN
@@ -1777,7 +1776,6 @@ RETURN
17771776
hour: 12, minute: 31, second: 14, nanosecond: 645876123
17781777
}) AS theDate
17791778
----
1780-
// end::functions_temporal_localtime_statement[]
17811779
17821780
.Result
17831781
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -1856,15 +1854,13 @@ RETURN theDate
18561854
The following query shows the various usages of `+localdatetime({date [, year, ..., nanosecond]})+`.
18571855
18581856
.Query
1859-
// tag::functions_temporal_localtime_realtime[]
18601857
[source, cypher]
18611858
----
18621859
WITH date({year: 1984, month: 10, day: 11}) AS dd
18631860
RETURN
18641861
localdatetime({date: dd, hour: 10, minute: 10, second: 10}) AS dateHHMMSS,
18651862
localdatetime({date: dd, day: 28, hour: 10, minute: 10, second: 10}) AS dateDDHHMMSS
18661863
----
1867-
// end::functions_temporal_localtime_realtime[]
18681864
18691865
.Result
18701866
[role="queryresult",options="header,footer",cols="2*<m"]
@@ -2234,10 +2230,12 @@ RETURN
22342230
======
22352231
22362232
.Query
2233+
// tag::functions_temporal_localtime[]
22372234
[source, cypher]
22382235
----
22392236
RETURN localtime() AS now
22402237
----
2238+
// end::functions_temporal_localtime[]
22412239
22422240
The current local time (i.e. in the local timezone) is returned.
22432241
@@ -2258,12 +2256,10 @@ The current local time (i.e. in the local timezone) is returned.
22582256
======
22592257
22602258
.Query
2261-
// tag::functions_temporal_time[]
22622259
[source, cypher]
22632260
----
22642261
RETURN localtime({timezone: 'America/Los Angeles'}) AS nowInLA
22652262
----
2266-
// end::functions_temporal_time[]
22672263
22682264
The current local time in California is returned.
22692265
@@ -2345,15 +2341,13 @@ RETURN theTime
23452341
======
23462342
23472343
.Query
2348-
// tag::functions_temporal_time_transaction[]
23492344
[source, cypher]
23502345
----
23512346
WITH time({hour: 12, minute: 31, second: 14, microsecond: 645876, timezone: '+01:00'}) AS tt
23522347
RETURN
23532348
localtime({time: tt}) AS timeOnly,
23542349
localtime({time: tt, second: 42}) AS timeSS
23552350
----
2356-
// end::functions_temporal_time_transaction[]
23572351
23582352
.Result
23592353
[role="queryresult",options="header,footer",cols="2*<m"]
@@ -2386,10 +2380,12 @@ The returned `LOCAL TIME` will be the live clock of the system.
23862380
======
23872381
23882382
.Query
2383+
// tag::functions_temporal_localtime_realtime[]
23892384
[source, cypher]
23902385
----
23912386
RETURN localtime.realtime() AS now
23922387
----
2388+
// end::functions_temporal_localtime_realtime[]
23932389
23942390
.Result
23952391
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -2422,12 +2418,12 @@ However, a different value may be produced for different statements within the s
24222418
======
24232419
24242420
.Query
2425-
// tag::functions_temporal_time_statement[]
2421+
// tag::functions_temporal_localtime_statement[]
24262422
[source, cypher]
24272423
----
24282424
RETURN localtime.statement() AS now
24292425
----
2430-
// end::functions_temporal_time_statement[]
2426+
// end::functions_temporal_localtime_statement[]
24312427
24322428
.Result
24332429
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -2483,10 +2479,12 @@ However, a different value may be produced for different transactions.
24832479
======
24842480
24852481
.Query
2482+
// tag::functions_temporal_localtime_transaction[]
24862483
[source, cypher]
24872484
----
24882485
RETURN localtime.transaction() AS now
24892486
----
2487+
// end::functions_temporal_localtime_transaction[]
24902488
24912489
.Result
24922490
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -2540,7 +2538,6 @@ However, the timezone of `input` is retained.
25402538
======
25412539
25422540
.Query
2543-
// tag::functions_temporal_time_realtime[]
25442541
[source, cypher]
25452542
----
25462543
WITH time({hour: 12, minute: 31, second: 14, nanosecond: 645876123, timezone: '-01:00'}) AS t
@@ -2552,7 +2549,6 @@ RETURN
25522549
localtime.truncate('millisecond', t) AS truncMillisecond,
25532550
localtime.truncate('microsecond', t) AS truncMicrosecond
25542551
----
2555-
// end::functions_temporal_time_realtime[]
25562552
25572553
.Result
25582554
[role="queryresult",options="header,footer",cols="6*<m"]
@@ -2635,10 +2631,13 @@ RETURN
26352631
======
26362632
26372633
.Query
2634+
// tag::functions_temporal_time[]
26382635
[source, cypher]
26392636
----
26402637
RETURN time() AS currentTime
26412638
----
2639+
// end::functions_temporal_time[]
2640+
26422641
26432642
The current time of day using the local timezone is returned.
26442643
@@ -2798,10 +2797,13 @@ The returned `ZONED TIME` will be the live clock of the system.
27982797
======
27992798
28002799
.Query
2800+
// tag::functions_temporal_time_realtime[]
28012801
[source, cypher]
28022802
----
28032803
RETURN time.realtime() AS currentTime
28042804
----
2805+
// end::functions_temporal_time_realtime[]
2806+
28052807
28062808
.Result
28072809
[role="queryresult",options="header,footer",cols="1*<m"]
@@ -2834,6 +2836,8 @@ However, a different value may be produced for different statements within the s
28342836
======
28352837
28362838
.Query
2839+
// tag::functions_temporal_time_statement[]
2840+
28372841
[source, cypher]
28382842
----
28392843
RETURN time.statement() AS currentTime
@@ -2893,10 +2897,13 @@ However, a different value may be produced for different transactions.
28932897
======
28942898
28952899
.Query
2900+
// tag::functions_temporal_time_transaction[]
28962901
[source, cypher]
28972902
----
28982903
RETURN time.transaction() AS currentTime
28992904
----
2905+
// end::functions_temporal_time_transaction[]
2906+
29002907
29012908
.Result
29022909
[role="queryresult",options="header,footer",cols="1*<m"]

0 commit comments

Comments
 (0)