Table of Contents

Class ZonedDateTime

Namespace
Neo4j.Driver
Assembly
Neo4j.Driver.dll

Represents a date time value with a time zone, specified as a UTC offset

public sealed class ZonedDateTime : TemporalValue, IConvertible, IEquatable<ZonedDateTime>, IComparable, IComparable<ZonedDateTime>
Inheritance
ZonedDateTime
Implements
Inherited Members
Extension Methods

Constructors

ZonedDateTime(DateTime, int)

Initializes a new instance of ZonedDateTime from given DateTime value.

ZonedDateTime(DateTime, string)

Initializes a new instance of ZonedDateTime from given DateTime value.

ZonedDateTime(DateTime, TimeSpan)

Initializes a new instance of ZonedDateTime from given DateTime value.

ZonedDateTime(DateTimeOffset)

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

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

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

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

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

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.

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.

Fields

Comparer

Default comparer for ZonedDateTime values.

Properties

Ambiguous

Gets if this instance is has a possible ambiguity.
If the date specified is near a daylight saving it could have been misinterpreted.
The most common cause for this will be because the DateTime used to construct this instance did not have a Kind specified as Utc. In order to reliably look up the offsets at a given time in a timezone we require a monotonic datetime.

Day

Gets the day of month component of this instance in the Locale of Zone.

EpochTicks

Gets the number of Ticks from the Unix Epoch (00:00:00 UTC, Thursday, 1 January 1970). This will truncate Nanosecond to closest tick.

Hour

Gets the hour component of this instance in the Locale of Zone.

LocalDateTime

Gets a DateTime value that represents the local date and time of this instance.

Minute

Gets the minute component of this instance in the Locale of Zone.

Month

Gets the month component of this instance in the Locale of Zone.

Nanosecond

Gets the nanosecond component of this instance.

OffsetSeconds

Gets the offset from UTC in seconds.
if Zone is of type ZoneOffset this will return OffsetSeconds.
otherwise Zone is of type ZoneId and this will return the UTC offset at the exact point of time of UtcDateTime.

Reason

Gets why this instance is has set Ambiguous as true.

Second

Gets the second component of this instance in the Locale of Zone.

UnknownZoneInfo

The Zone is not recognized by the driver, or operating system.
Attempting to call ToString() or LocalDateTime will raise an TimeZoneNotFoundException.

UtcDateTime

Gets a DateTime the UTC value that represents the date and time of this instance.

UtcSeconds

Gets the number of seconds since the Unix Epoch (00:00:00 UTC, Thursday, 1 January 1970).
Introduced in 4.4.1 a fix to a long standing issue of not having a monotonic datetime used on construction or transmission.

Year

Gets the year component of this instance in the Locale of Zone.

Zone

The time zone that this instance represents.

Methods

CompareTo(ZonedDateTime)

Compares the value of this instance to a specified ZonedDateTime value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateTime value.

CompareTo(object)

Compares the value of this instance to a specified object which is expected to be a ZonedDateTime value, and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified ZonedDateTime value.

ConvertToDateTimeOffset()

Converts this TemporalValue instance to a DateTimeOffset instance.

Equals(ZonedDateTime)

Returns a value indicating whether the value of this instance is equal to the value of the specified ZonedDateTime instance.

Equals(object)

Returns a value indicating whether this instance is equal to a specified object.

GetHashCode()

Returns the hash code for this instance.

ToDateTimeOffset()

Converts this instance to an equivalent DateTimeOffset value

ToString()

Converts the value of the current ZonedDateTime object to its equivalent string representation.

Operators

operator >(ZonedDateTime, ZonedDateTime)

Determines whether one specified ZonedDateTime is later than another specified ZonedDateTime.

operator >=(ZonedDateTime, ZonedDateTime)

Determines whether one specified ZonedDateTime represents a duration that is the same as or earlier than the other specified ZonedDateTime

operator <(ZonedDateTime, ZonedDateTime)

Determines whether one specified ZonedDateTime is earlier than another specified ZonedDateTime.

operator <=(ZonedDateTime, ZonedDateTime)

Determines whether one specified ZonedDateTime represents a duration that is the same as or later than the other specified ZonedDateTime