Skip to content
Documentation

Period Struct

A struct used to describe periods of time.

public readonly struct Period : System.IComparable<HAKOM.TSM.Net.Api.Time.Periods.Period>, System.IEquatable<HAKOM.TSM.Net.Api.Time.Periods.Period>

Implements System.IComparable<Period>, System.IEquatable<Period>

Gets the System.DateTimeOffset representing the beginning of the period.

public System.DateTimeOffset From { get; }

System.DateTimeOffset

Gets the System.DateTimeOffset representing the end of the period.

public System.DateTimeOffset To { get; }

System.DateTimeOffset

Compares this period to the given other by their duration and, if their duration is the same, by their from parameters.

public int CompareTo(HAKOM.TSM.Net.Api.Time.Periods.Period other);

other Period

The other Period used for the comparison.

System.Int32

  • A negative System.Int32, if this period is shorter (or starts earlier, if they’re equally long) than other
  • 0, if both have the same duration and start date
  • a positive System.Int32, if this period is longer (or starts later, if they’re equally long) than other

Period.Create(DateTimeOffset, DateTimeOffset) Method

Section titled “Period.Create(DateTimeOffset, DateTimeOffset) Method”

Creates a new instance of Period with the given from and to.

public static HAKOM.TSM.Net.Api.Time.Periods.Period Create(System.DateTimeOffset from, System.DateTimeOffset to);

from System.DateTimeOffset

The System.DateTimeOffset representing the beginning of the new period.

to System.DateTimeOffset

The System.DateTimeOffset representing the end of the new period.

Period
A new instance of Period.

Creates a default instance of Period with default values for the from and to parameters. The default instance exists to ensure, that periods not created by the static Create method have a from parameter, which is before their to parameter.

public static HAKOM.TSM.Net.Api.Time.Periods.Period Default();

Period
The default instance of Period.

Compares this period to the given other for equality.

public bool Equals(HAKOM.TSM.Net.Api.Time.Periods.Period other);

other Period

The other Period used for the comparison.

System.Boolean
True, if the periods are equal in duration and start time, otherwise false.

Compares this period to the given obj for equality.

public override bool Equals(object? obj);

obj System.Object

The other System.Object used for the comparison.

System.Boolean
True, if the object is a period with equal duration and start time, otherwise false.

Creates a hash for this period, using its from and to parameters.

public override int GetHashCode();

System.Int32
A hash code for this period.

Checks if Period has bounds.

public static bool IsBounded(HAKOM.TSM.Net.Api.Time.Periods.Period period);

period Period

The Period to be checked.

System.Boolean
true if either From or To is not respectively Min/MaxValue otherwise false

Period.ToPeriod((DateTimeOffset,DateTimeOffset)) Method

Section titled “Period.ToPeriod((DateTimeOffset,DateTimeOffset)) Method”
public static HAKOM.TSM.Net.Api.Time.Periods.Period ToPeriod((System.DateTimeOffset,System.DateTimeOffset) range);

range <System.DateTimeOffset,System.DateTimeOffset>

Period

Used to get a string representation of the period, using its from and to properties, separated by a comma.

public override string ToString();

System.String
A System.String representation of the period.

Period.TryCreate(DateTimeOffset, DateTimeOffset) Method

Section titled “Period.TryCreate(DateTimeOffset, DateTimeOffset) Method”

Attempts to create a new instance of Period with the given from and to.

public static HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Time.Periods.Period> TryCreate(System.DateTimeOffset from, System.DateTimeOffset to);

from System.DateTimeOffset

The System.DateTimeOffset representing the beginning of the new period.

to System.DateTimeOffset

The System.DateTimeOffset representing the end of the new period.

HAKOM.ErrorHandling.Core.Net.Api.Result<Period>
A Result<TValue> indicating if the period could successfully be created

Period.operator ==(Period, Period) Operator

Section titled “Period.operator ==(Period, Period) Operator”

Compares the given periods using the ‘==’ operator.

public static bool operator ==(HAKOM.TSM.Net.Api.Time.Periods.Period left, HAKOM.TSM.Net.Api.Time.Periods.Period right);

left Period

The Period on the left of the ‘==’.

right Period

The Period on the right of the ‘==’.

System.Boolean
True, if the given periods are equal, otherwise false.

Period.operator >(Period, Period) Operator

Section titled “Period.operator >(Period, Period) Operator”

Compares the left Period to the right Period by their duration and, if their duration is the same, by their from parameters using the ‘>’ operator.

public static bool operator >(HAKOM.TSM.Net.Api.Time.Periods.Period left, HAKOM.TSM.Net.Api.Time.Periods.Period right);

left Period

The Period on the left of the ‘>’.

right Period

The Period on the right of the ‘>’.

System.Boolean
True, if the left Period is longer (or starts later, if they’re equally long) than the right Period, otherwise false.

Period.operator >=(Period, Period) Operator

Section titled “Period.operator >=(Period, Period) Operator”

Compares the left Period to the right Period by their duration and, if their duration is the same, by their from parameters using the ‘>=’ operator.

public static bool operator >=(HAKOM.TSM.Net.Api.Time.Periods.Period left, HAKOM.TSM.Net.Api.Time.Periods.Period right);

left Period

The Period on the left of the ‘>=’.

right Period

The Period on the right of the ‘>=’.

System.Boolean
True, if the left Period is longer (or starts later, if they’re equally long) than the right Period or both periods are equally long and start at the same time, otherwise false.

Period.implicit operator Period((DateTimeOffset,DateTimeOffset)) Operator

Section titled “Period.implicit operator Period((DateTimeOffset,DateTimeOffset)) Operator”
public static HAKOM.TSM.Net.Api.Time.Periods.Period implicit operator HAKOM.TSM.Net.Api.Time.Periods.Period((System.DateTimeOffset,System.DateTimeOffset) range);

range <System.DateTimeOffset,System.DateTimeOffset>

Period

Period.operator !=(Period, Period) Operator

Section titled “Period.operator !=(Period, Period) Operator”

Compares the given periods using the ‘!=’ operator.

public static bool operator !=(HAKOM.TSM.Net.Api.Time.Periods.Period left, HAKOM.TSM.Net.Api.Time.Periods.Period right);

left Period

The Period on the left of the ‘!=’.

right Period

The Period on the right of the ‘!=’.

System.Boolean
True, if the given periods are not equal, otherwise false.

Period.operator <(Period, Period) Operator

Section titled “Period.operator <(Period, Period) Operator”

Compares the left Period to the right Period by their duration and, if their duration is the same, by their from parameters using the ‘<’ operator.

public static bool operator <(HAKOM.TSM.Net.Api.Time.Periods.Period left, HAKOM.TSM.Net.Api.Time.Periods.Period right);

left Period

The Period on the left of the ‘<’.

right Period

The Period on the right of the ‘<’.

System.Boolean
True, if the left Period is shorter (or starts earlier, if they’re equally long) than the right Period, otherwise false.

Period.operator <=(Period, Period) Operator

Section titled “Period.operator <=(Period, Period) Operator”

Compares the left Period to the right Period by their duration and, if their duration is the same, by their from parameters using the ‘<=’ operator.

public static bool operator <=(HAKOM.TSM.Net.Api.Time.Periods.Period left, HAKOM.TSM.Net.Api.Time.Periods.Period right);

left Period

The Period on the left of the ‘<=’.

right Period

The Period on the right of the ‘<=’.

System.Boolean
True, if the left Period is shorter (or starts earlier, if they’re equally long) than the right Period or both periods are equally long and start at the same time, otherwise false.

© 2026 Volue.Version v0.6.38017 November 2026