Table of Contents

Struct DuckDBDateOnly

Namespace
DuckDB.NET.Native
Assembly
DuckDB.NET.Bindings.dll
public readonly struct DuckDBDateOnly : IEquatable<DuckDBDateOnly>
Implements
Inherited Members

Constructors

DuckDBDateOnly(int, byte, byte)

public DuckDBDateOnly(int year, byte month, byte day)

Parameters

year int
month byte
day byte

Fields

NegativeInfinity

Represents negative infinity for DuckDB dates.

public static readonly DuckDBDateOnly NegativeInfinity

Field Value

DuckDBDateOnly

PositiveInfinity

Represents positive infinity for DuckDB dates.

public static readonly DuckDBDateOnly PositiveInfinity

Field Value

DuckDBDateOnly

Properties

Day

public byte Day { get; }

Property Value

byte

IsInfinity

Returns true if this date represents positive or negative infinity.

public bool IsInfinity { get; }

Property Value

bool

IsNegativeInfinity

Returns true if this date represents negative infinity.

public bool IsNegativeInfinity { get; }

Property Value

bool

IsPositiveInfinity

Returns true if this date represents positive infinity.

public bool IsPositiveInfinity { get; }

Property Value

bool

Month

public byte Month { get; }

Property Value

byte

Year

public int Year { get; }

Property Value

int

Methods

Equals(DuckDBDateOnly)

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

public bool Equals(DuckDBDateOnly other)

Parameters

other DuckDBDateOnly

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.

FromDateOnly(DateOnly)

public static DuckDBDateOnly FromDateOnly(DateOnly dateOnly)

Parameters

dateOnly DateOnly

Returns

DuckDBDateOnly

FromDateTime(DateTime)

public static DuckDBDateOnly FromDateTime(DateTime dateTime)

Parameters

dateTime DateTime

Returns

DuckDBDateOnly

FromDuckDBDate(DuckDBDate)

Converts a DuckDBDate to DuckDBDateOnly, handling infinity values.

public static DuckDBDateOnly FromDuckDBDate(DuckDBDate date)

Parameters

date DuckDBDate

Returns

DuckDBDateOnly

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.

ToDateOnly()

public DateOnly ToDateOnly()

Returns

DateOnly

ToDateTime()

public DateTime ToDateTime()

Returns

DateTime

ToDuckDBDate()

Converts this DuckDBDateOnly to a DuckDBDate, handling infinity values.

public DuckDBDate ToDuckDBDate()

Returns

DuckDBDate

Operators

explicit operator DateTime(DuckDBDateOnly)

public static explicit operator DateTime(DuckDBDateOnly dateOnly)

Parameters

dateOnly DuckDBDateOnly

Returns

DateTime

explicit operator DuckDBDateOnly(DateTime)

public static explicit operator DuckDBDateOnly(DateTime dateTime)

Parameters

dateTime DateTime

Returns

DuckDBDateOnly

implicit operator DateOnly(DuckDBDateOnly)

public static implicit operator DateOnly(DuckDBDateOnly dateOnly)

Parameters

dateOnly DuckDBDateOnly

Returns

DateOnly

implicit operator DuckDBDateOnly(DateOnly)

public static implicit operator DuckDBDateOnly(DateOnly date)

Parameters

date DateOnly

Returns

DuckDBDateOnly