Table of Contents

Struct DateTimeNanos

Namespace
ParquetSharp
Assembly
ParquetSharp.dll

Represents a Parquet Timestamp with Nanoseconds time unit.

public readonly struct DateTimeNanos : IEquatable<DateTimeNanos>, IComparable, IComparable<DateTimeNanos>
Implements
Inherited Members

Constructors

DateTimeNanos(DateTime)

public DateTimeNanos(DateTime dateTime)

Parameters

dateTime DateTime

DateTimeNanos(long)

public DateTimeNanos(long ticks)

Parameters

ticks long

Fields

MaxDateTimeValue

Maximum DateTime representable: 2262-04-11 23:47:16.

public static readonly DateTime MaxDateTimeValue

Field Value

DateTime

MinDateTimeValue

Minimum DateTime representable: 1677-09-21 00:12:43.

public static readonly DateTime MinDateTimeValue

Field Value

DateTime

Ticks

Number of nanoseconds since 1970-01-01 00:00:00.

public readonly long Ticks

Field Value

long

Properties

DateTime

Convert to System.DateTime with reduced precision.

public DateTime DateTime { get; }

Property Value

DateTime

Methods

CompareTo(DateTimeNanos)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(DateTimeNanos other)

Parameters

other DateTimeNanos

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

CompareTo(object?)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(object? obj)

Parameters

obj object

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes obj in the sort order.
Zero This instance occurs in the same position in the sort order as obj.
Greater than zero This instance follows obj in the sort order.

Exceptions

ArgumentException

obj is not the same type as this instance.

Equals(DateTimeNanos)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(DateTimeNanos other)

Parameters

other DateTimeNanos

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

FromDotnetTicks(long)

Make a new DateTimeNanos object from a specified dotnet ticks value

public static DateTimeNanos FromDotnetTicks(long dotnetTicks)

Parameters

dotnetTicks long

Returns

DateTimeNanos

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Converts this DateTimeNanos object to a string using a default formatting string with nanosecond precision and the current culture's formatting conventions.

public override string ToString()

Returns

string

String representation of this DateTimeNanos object

ToString(string?, IFormatProvider?)

Converts this DateTimeNanos object to a string using the specified format and culture-specific format information.

public string ToString(string? format, IFormatProvider? formatProvider = null)

Parameters

format string

A standard or custom format string. This supports dotnet DateTime format specifiers with the addition of "fffffffff" for the number of nanoseconds when using a custom format. If null, a default formatting string with nanosecond precision is used.

formatProvider IFormatProvider

An object that supplies culture-specific formatting information. If null, the current culture's formatting conventions are used.

Returns

string

String representation of this DateTimeNanos object

Operators

operator ==(DateTimeNanos, DateTimeNanos)

public static bool operator ==(DateTimeNanos left, DateTimeNanos right)

Parameters

left DateTimeNanos
right DateTimeNanos

Returns

bool

operator >(DateTimeNanos, DateTimeNanos)

public static bool operator >(DateTimeNanos left, DateTimeNanos right)

Parameters

left DateTimeNanos
right DateTimeNanos

Returns

bool

operator >=(DateTimeNanos, DateTimeNanos)

public static bool operator >=(DateTimeNanos left, DateTimeNanos right)

Parameters

left DateTimeNanos
right DateTimeNanos

Returns

bool

operator !=(DateTimeNanos, DateTimeNanos)

public static bool operator !=(DateTimeNanos left, DateTimeNanos right)

Parameters

left DateTimeNanos
right DateTimeNanos

Returns

bool

operator <(DateTimeNanos, DateTimeNanos)

public static bool operator <(DateTimeNanos left, DateTimeNanos right)

Parameters

left DateTimeNanos
right DateTimeNanos

Returns

bool

operator <=(DateTimeNanos, DateTimeNanos)

public static bool operator <=(DateTimeNanos left, DateTimeNanos right)

Parameters

left DateTimeNanos
right DateTimeNanos

Returns

bool