Table of Contents

Class RelativeDate

Namespace
The.Search
Assembly
Instagile.dll

Represents a date relative to some point in the client's timezone which can be evaluated during query execution.

public sealed class RelativeDate
Inheritance
RelativeDate
Inherited Members

Remarks

Evaluation applies calendar-month offsets, then working-day offsets, to the anchor before any day/time offset, regardless of the order of Add* calls.

Constructors

RelativeDate(Anchor, TimeSpan)

public RelativeDate(RelativeDate.Anchor anchor, TimeSpan offset)

Parameters

anchor RelativeDate.Anchor
offset TimeSpan

Properties

Now

public static RelativeDate Now { get; }

Property Value

RelativeDate

Today

public static RelativeDate Today { get; }

Property Value

RelativeDate

Methods

Add(TimeSpan)

public RelativeDate Add(TimeSpan value)

Parameters

value TimeSpan

Returns

RelativeDate

AddDays(double)

public RelativeDate AddDays(double days)

Parameters

days double

Returns

RelativeDate

AddHours(double)

public RelativeDate AddHours(double hours)

Parameters

hours double

Returns

RelativeDate

AddMinutes(double)

public RelativeDate AddMinutes(double minutes)

Parameters

minutes double

Returns

RelativeDate

AddMonths(int)

Add calendar months, clamping to the last day of the target month (like AddMonths(int)).

public RelativeDate AddMonths(int months)

Parameters

months int

Returns

RelativeDate

AddSeconds(double)

public RelativeDate AddSeconds(double seconds)

Parameters

seconds double

Returns

RelativeDate

AddWorkingDays(int)

Add working days, skipping Saturdays and Sundays: the accumulated steps move to the next (or previous) non-weekend day, preserving the time of day.

public RelativeDate AddWorkingDays(int days)

Parameters

days int

Returns

RelativeDate

Equals(object?)

Relative dates with the same anchor, months, working days and offset are equal, regardless of how they were built.

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

implicit operator DateOnly(RelativeDate)

public static implicit operator DateOnly(RelativeDate value)

Parameters

value RelativeDate

Returns

DateOnly

implicit operator DateTime(RelativeDate)

public static implicit operator DateTime(RelativeDate value)

Parameters

value RelativeDate

Returns

DateTime

implicit operator DateTimeOffset(RelativeDate)

public static implicit operator DateTimeOffset(RelativeDate value)

Parameters

value RelativeDate

Returns

DateTimeOffset