apoc.temporal.toZonedTemporal

This function is deprecated. Use Cypher’s corresponding temporal type constructor instead, for example datetime().

Details

Syntax

apoc.temporal.toZonedTemporal(time [, format, timezone ])

Description

Parses the given date STRING using the specified format into the given time zone.

Arguments

Name

Type

Description

time

STRING

The date string to be parsed.

format

STRING

The format of the given date string. The default is: yyyy-MM-dd HH:mm:ss.

timezone

STRING

The timezone the given string is in. The default is: UTC.

Returns

ZONED DATETIME

Usage Examples

apoc.temporal.toZonedTemporal
RETURN apoc.temporal.toZonedTemporal('2012-12-23 23:59:59',"yyyy-MM-dd HH:mm:ss") AS output;
Cypher’s pattern constructors
RETURN datetime('2012-12-23 23:59:59',"yyyy-MM-dd HH:mm:ss") AS output;
Results
output

2012-12-23T23:59:59Z[UTC]

apoc.temporal.toZonedTemporal
RETURN apoc.temporal.toZonedTemporal('2012-12-23 23:59:59',"yyyy-MM-dd HH:mm:ss", "+04:30") AS output;
Cypher’s pattern constructors
RETURN datetime({datetime: localdatetime('2012-12-23 23:59:59',"yyyy-MM-dd HH:mm:ss"), timezone: "+04:30"}) AS output;
Results
output

2012-12-24T04:29:59+04:30

apoc.temporal.toZonedTemporal
RETURN apoc.temporal.toZonedTemporal('2012-12-23 23:59:59',"yyyy-MM-dd HH:mm:ss", "Pacific/Auckland") AS output;
Cypher’s pattern constructors
RETURN datetime({datetime: localdatetime('2012-12-23 23:59:59',"yyyy-MM-dd HH:mm:ss"), timezone: "Pacific/Auckland"}) AS output;
Results
output

2012-12-23T23:59:59+13:00[Pacific/Auckland]