Table of Contents

Constructor ZonedDateTime

Namespace
Neo4j.Driver
Assembly
Neo4j.Driver.dll

ZonedDateTime(long, int, Zone)

Create a new instance of ZonedDateTime using delta from unix epoch (1970-1-1 00:00:00.00 UTC).
Allows handling values in range for neo4j and outside of the range of BCL date/time types (DateTime, DateTimeOffset). When utcSeconds is outside of BCL date/time types range (-62_135_596_800, 253_402_300_799) and zone is a ZoneId the ZonedDateTime instance will be marked as Ambiguous as TimeZoneInfo does not support BCL date/time type ranges.

public ZonedDateTime(long utcSeconds, int nanos, Zone zone)

Parameters

utcSeconds long

Seconds from unix epoch (1970-1-1 00:00:00.00 UTC).

nanos int

Nanoseconds of the second.

zone Zone

Zone for offsetting utc to local.

ZonedDateTime(long, Zone)

Create a new instance of ZonedDateTime using delta from unix epoch (1970-1-1 00:00:00.00 UTC) in ticks.
Allows handling values in range for neo4j and outside of the range of BCL date types (DateTime, DateTimeOffset). When ticks is outside of BCL date ranges (-621_355_968_000_000_000, 2_534_023_009_990_000_000) and zone is a ZoneId the ZonedDateTime instance will be marked as Ambiguous.

public ZonedDateTime(long ticks, Zone zone)

Parameters

ticks long

ticks from unix epoch (1970-1-1 00:00:00.00 UTC).

zone Zone

Zone for offsetting utc to local.

ZonedDateTime(DateTimeOffset)

Initializes a new instance of ZonedDateTime from given the DateTimeOffset value.

public ZonedDateTime(DateTimeOffset dateTimeOffset)

Parameters

dateTimeOffset DateTimeOffset

ZonedDateTime(DateTime, TimeSpan)

Initializes a new instance of ZonedDateTime from given DateTime value.

public ZonedDateTime(DateTime dateTime, TimeSpan offset)

Parameters

dateTime DateTime

Date time instance, If Kind is Unspecifiedthe instance will set Ambiguous as

true
.
offset TimeSpan

TimeSpan to offset datetime by, will be converted into ZoneOffset.

Remarks

When dateTime is Utc, this instance's date time components (Year...) will be offset by offset.

ZonedDateTime(DateTime, int)

Initializes a new instance of ZonedDateTime from given DateTime value.

public ZonedDateTime(DateTime dateTime, int offsetSeconds)

Parameters

dateTime DateTime

Date time instance, If Kind is Unspecifiedthe instance will set Ambiguous as

true
.
offsetSeconds int

Seconds to offset datetime by, will be converted into ZoneOffset.

Remarks

When dateTime is Utc, this instance's date time components (Year...) will be offset by offsetSeconds.

ZonedDateTime(DateTime, string)

Initializes a new instance of ZonedDateTime from given DateTime value.

public ZonedDateTime(DateTime dateTime, string zoneId)

Parameters

dateTime DateTime

Date time instance, should be local or utc.

zoneId string

Zone name, if zone name is not known by the operating system and dateTime's Kind is not Utc, the driver can not correctly set UtcSeconds which is required for server versions 5+, 4.4.12+, 4.3.19+.
if dateTime'sKind is Utc, the TimeZoneNotFoundException will be caught, unless one of the local values (Year..) is accessed and can be sent to the server.

Exceptions

TimeZoneNotFoundException

if zone name is not known by the operating system and dateTime's Kind is not Utc, the driver can not correctly set UtcSeconds which is required for server versions 5+, 4.4.12+, 4.3.19+.

ZonedDateTime(int, int, int, int, int, int, Zone)

Initializes a new instance of ZonedDateTime from individual local date time component values.

[Obsolete("Deprecated, This constructor does not support a kind, so not known if utc or local.")]
public ZonedDateTime(int year, int month, int day, int hour, int minute, int second, Zone zone)

Parameters

year int

Local year value.

month int

Local month value.

day int

Local day value.

hour int

Local hour value.

minute int

Local minute value.

second int

Local second value.

zone Zone

Zone of this date time, will be used to calculate UtcSeconds from local values.

Exceptions

TimeZoneNotFoundException

if zone name is not known by the operating system.

ZonedDateTime(int, int, int, int, int, int, int, Zone)

Initializes a new instance of ZonedDateTime from individual local date time component values.

[Obsolete("Deprecated, This constructor does not support a kind, so not known if utc or local.")]
public ZonedDateTime(int year, int month, int day, int hour, int minute, int second, int nanosecond, Zone zone)

Parameters

year int

Local year value.

month int

Local month value.

day int

Local day value.

hour int

Local hour value.

minute int

Local minute value.

second int

Local second value.

nanosecond int

Nanoseconds of the second.

zone Zone

Zone of this date time, will be used to calculate UtcSeconds from local values.

Exceptions

TimeZoneNotFoundException

if zone name is not known by the operating system.