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
utcSeconds
longSeconds from unix epoch (1970-1-1 00:00:00.00 UTC).
nanos
intNanoseconds of the second.
zone
ZoneZone 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
ticks
longticks from unix epoch (1970-1-1 00:00:00.00 UTC).
zone
ZoneZone 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
DateTimeDate time instance, If Kind is Unspecifiedthe instance will set Ambiguous as
.true
offset
TimeSpanTimeSpan 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
DateTimeDate time instance, If Kind is Unspecifiedthe instance will set Ambiguous as
.true
offsetSeconds
intSeconds 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
DateTimeDate time instance, should be local or utc.
zoneId
stringZone 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
year
intLocal year value.
month
intLocal month value.
day
intLocal day value.
hour
intLocal hour value.
minute
intLocal minute value.
second
intLocal second value.
zone
ZoneZone 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
intLocal year value.
month
intLocal month value.
day
intLocal day value.
hour
intLocal hour value.
minute
intLocal minute value.
second
intLocal second value.
nanosecond
intNanoseconds of the second.
zone
ZoneZone 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.