Struct DuckDbInterval
Time interval in DuckDB.
Inherited Members
Namespace: Mallard.Types
Assembly: Mallard.dll
Syntax
public struct DuckDbInterval
Remarks
Note that the DuckDB's time intervals use 3 basis units: months, days, microseconds, unlike .NET TimeSpan type.
Fields
| Edit this page View SourceDays
The number of days to offset by in time calculations.
Declaration
public int Days
Field Value
Type | Description |
---|---|
int |
Microseconds
The number of microseconds to offset by in time calculations.
Declaration
public int Microseconds
Field Value
Type | Description |
---|---|
int |
Months
The number of months to offset by in time calculations.
Declaration
public int Months
Field Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceFromTimeSpan(TimeSpan, bool)
Convert from a .NET time span.
Declaration
public static DuckDbInterval FromTimeSpan(TimeSpan timeSpan, bool exact = true)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | timeSpan | The desired time span to convert to the DuckDB representation. |
bool | exact | If true, fail if |
Returns
Type | Description |
---|---|
DuckDbInterval | The DuckDB interval. |
Exceptions
Type | Condition |
---|---|
ArgumentException | There are fractional microseconds and |
ToTimeSpan()
Convert to a .NET time span if possible.
Declaration
public readonly TimeSpan ToTimeSpan()
Returns
Type | Description |
---|---|
TimeSpan |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | This instance contains a month component (Months is non-zero), which cannot be represented in a TimeSpan (since the number of days in a month differs between months). |