Constructor ZonedDateTime
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).
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
utcSecondslongSeconds from unix epoch (1970-1-1 00:00:00.00 UTC).
nanosintNanoseconds of the second.
zoneZoneZone 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).
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
tickslongticks from unix epoch (1970-1-1 00:00:00.00 UTC).
zoneZoneZone for offsetting utc to local.
ZonedDateTime(DateTimeOffset)
Initializes a new instance of ZonedDateTime from given the DateTimeOffset value.
public ZonedDateTime(DateTimeOffset dateTimeOffset)
Parameters
dateTimeOffsetDateTimeOffset
ZonedDateTime(DateTime, TimeSpan)
Initializes a new instance of ZonedDateTime from given DateTime value.
public ZonedDateTime(DateTime dateTime, TimeSpan offset)
Parameters
dateTimeDateTimeDate time instance, If Kind is Unspecifiedthe instance will set Ambiguous as
.trueoffsetTimeSpanTimeSpan 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
dateTimeDateTimeDate time instance, If Kind is Unspecifiedthe instance will set Ambiguous as
.trueoffsetSecondsintSeconds 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
dateTimeDateTimeDate time instance, should be local or utc.
zoneIdstringZone 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+.
ifdateTime'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
yearintLocal year value.
monthintLocal month value.
dayintLocal day value.
hourintLocal hour value.
minuteintLocal minute value.
secondintLocal second value.
zoneZoneZone 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
yearintLocal year value.
monthintLocal month value.
dayintLocal day value.
hourintLocal hour value.
minuteintLocal minute value.
secondintLocal second value.
nanosecondintNanoseconds of the second.
zoneZoneZone 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.