Skip to content

Commit

Permalink
Fixes neo4j-contrib#2748: apoc.temporal.toZonedTemporal missing in te…
Browse files Browse the repository at this point in the history
…mporal docs page
  • Loading branch information
vga91 committed Apr 27, 2022
1 parent d08182d commit 41b74aa
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ This function parses a date string in a specified format and converts it to a Ne

[NOTE]
====
This function has been renamed to `apoc.temporal.toZonedDateTime` and moved to the temporal section.
This function has been renamed to `apoc.temporal.toZonedTemporal` and moved to the temporal section.
See xref::temporal/temporal-conversions.adoc[].
====

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,39 @@ RETURN apoc.temporal.format( duration.between( datetime.transaction(), datetime.
| Output
| "00:00:00.0110"
|===

== To ZonedDateTime

You can pass a string to be converted as a 1st parameter,
a pattern to convert the string into a `ZonedDateTime` as a 2nd parameter (default: 'yyyy-MM-dd HH:mm:ss'),
and the timezone as a 3rd parameter (default: 'UTC').


For example, using the default pattern and timezone:

[source,cypher]
----
RETURN apoc.temporal.toZonedTemporal('2015-12-23 23:59:59') AS output;
----

.Results
[opts="header",cols="1"]
|===
| Output
| "2015-12-23T23:59:59[UTC]"
|===

or:

[source,cypher]
----
RETURN apoc.temporal.toZonedTemporal('2012-12-23T23:59:59', "yyyy-MM-dd'T'HH:mm:ss", "Asia/Tokyo") AS output;
----

.Results
[opts="header",cols="1"]
|===
| Output
| "2012-12-23T23:59:59[Asia/Tokyo]"

|===
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Furthermore, we can specify a `maxDepth` to consider cycles with only `n` interm
MATCH (m1:Start) WITH collect(m1) as nodes CALL apoc.nodes.cycles(nodes, {maxDepth: 1}) YIELD path RETURN path
----

image::cycles_max_depth_1.png
image::cycles_max_depth_1.png[width=800]



Expand Down

0 comments on commit 41b74aa

Please sign in to comment.