Struct ZonedDay
Represents a day with time zone.
public readonly struct ZonedDay : IEquatable<ZonedDay>, IComparable<ZonedDay>, IComparable
  - Implements
 
- Inherited Members
 
Properties
DayOfMonth
Day of month component.
public int DayOfMonth { get; }
  Property Value
DayOfWeek
Day of week component.
public IsoDayOfWeek DayOfWeek { get; }
  Property Value
DayOfYear
Day of year component.
public int DayOfYear { get; }
  Property Value
Duration
Duration of this day.
public Duration Duration { get; }
  Property Value
End
End of this day.
public ZonedDateTime End { get; }
  Property Value
IsLocal
Checks whether or not the TimeZone is local.
public bool IsLocal { get; }
  Property Value
IsUtc
Checks whether or not the TimeZone is UTC.
public bool IsUtc { get; }
  Property Value
Month
Month component.
public IsoMonthOfYear Month { get; }
  Property Value
Start
Start of this day.
public ZonedDateTime Start { get; }
  Property Value
TimeZone
Time zone of this day.
public TimeZoneInfo TimeZone { get; }
  Property Value
Year
Year component.
public int Year { get; }
  Property Value
Methods
Add(Period)
Creates a new ZonedDay instance by adding value to this instance.
[Pure]
public ZonedDay Add(Period value)
  Parameters
Returns
AddDays(int)
Creates a new ZonedDay instance by adding provided number of days to this instance.
[Pure]
public ZonedDay AddDays(int days)
  Parameters
daysintNumber of days to add.
Returns
CompareTo(ZonedDay)
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.
[Pure]
public int CompareTo(ZonedDay other)
  Parameters
otherZonedDayAn 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 otherin the sort order.Zero This instance occurs in the same position in the sort order as other.Greater than zero This instance follows otherin 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.
[Pure]
public int CompareTo(object? obj)
  Parameters
objobjectAn 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 objin the sort order.Zero This instance occurs in the same position in the sort order as obj.Greater than zero This instance follows objin the sort order.
Exceptions
- ArgumentException
 objis not the same type as this instance.
Contains(ZonedDateTime)
Checks whether or not the provided dateTime belongs to this day.
[Pure]
public bool Contains(ZonedDateTime dateTime)
  Parameters
dateTimeZonedDateTimeDate time to check.
Returns
- bool
 true when the provided
dateTimebelongs to this day, otherwise false.
Create(ZonedDateTime)
Creates a new ZonedDay instance.
[Pure]
public static ZonedDay Create(ZonedDateTime dateTime)
  Parameters
dateTimeZonedDateTimeDate time contained by the result.
Returns
Create(DateTime, TimeZoneInfo)
Creates a new ZonedDay instance.
[Pure]
public static ZonedDay Create(DateTime dateTime, TimeZoneInfo timeZone)
  Parameters
dateTimeDateTimeDate time contained by the result.
timeZoneTimeZoneInfoTarget time zone.
Returns
CreateLocal(DateTime)
[Pure]
public static ZonedDay CreateLocal(DateTime localDateTime)
  Parameters
localDateTimeDateTimeDate time contained by the result.
Returns
CreateUtc(Timestamp)
[Pure]
public static ZonedDay CreateUtc(Timestamp timestamp)
  Parameters
timestampTimestampTimestamp contained by the result.
Returns
CreateUtc(DateTime)
[Pure]
public static ZonedDay CreateUtc(DateTime utcDateTime)
  Parameters
utcDateTimeDateTimeDate time contained by the result.
Returns
Equals(ZonedDay)
Indicates whether the current object is equal to another object of the same type.
[Pure]
public bool Equals(ZonedDay other)
  Parameters
otherZonedDayAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
[Pure]
public override bool Equals(object? obj)
  Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
 true if
objand this instance are the same type and represent the same value; otherwise, false.
GetDateTime(TimeOfDay)
Creates a new ZonedDateTime instance by setting the TimeOfDay component in this instance's Start date time.
[Pure]
public ZonedDateTime GetDateTime(TimeOfDay timeOfDay)
  Parameters
timeOfDayTimeOfDayTime of day to set.
Returns
- ZonedDateTime
 New ZonedDateTime instance.
Exceptions
- InvalidZonedDateTimeException
 When result is not valid in this instance's TimeZone.
GetGreedyPeriodOffset(ZonedDay, PeriodUnits)
Creates a new Period instance by calculating a difference between this instance and
the start instance, where this instance is treated as the end of the range,
using the specified units.
[Pure]
public Period GetGreedyPeriodOffset(ZonedDay start, PeriodUnits units)
  Parameters
startZonedDayStart day.
unitsPeriodUnitsPeriodUnits to include in the calculated difference.
Returns
Remarks
Greedy Period may contain components with negative values.
GetHashCode()
Returns the hash code for this instance.
[Pure]
public override int GetHashCode()
  Returns
- int
 A 32-bit signed integer that is the hash code for this instance.
GetIntersectingAmbiguityRange()
Attempts to find the range of ambiguous date times in this instance, according to its TimeZone.
[Pure]
public Bounds<DateTime>? GetIntersectingAmbiguityRange()
  Returns
- Bounds<DateTime>?
 New Bounds<T> instance that represents the range of ambiguous date times or null when this instance does not contain invalid date times.
GetIntersectingInvalidityRange()
Attempts to find the range of invalid date times in this instance, according to its TimeZone.
[Pure]
public Bounds<DateTime>? GetIntersectingInvalidityRange()
  Returns
- Bounds<DateTime>?
 New Bounds<T> instance that represents the range of invalid date times or null when this instance does not contain invalid date times.
GetMonth()
Creates a new ZonedMonth instance that contains this instance.
[Pure]
public ZonedMonth GetMonth()
  Returns
- ZonedMonth
 New ZonedMonth instance.
GetNext()
Creates a new ZonedDay instance by calculating the next day.
[Pure]
public ZonedDay GetNext()
  Returns
GetPeriodOffset(ZonedDay, PeriodUnits)
Creates a new Period instance by calculating a difference between this instance and
the start instance, where this instance is treated as the end of the range,
using the specified units.
[Pure]
public Period GetPeriodOffset(ZonedDay start, PeriodUnits units)
  Parameters
startZonedDayStart day.
unitsPeriodUnitsPeriodUnits to include in the calculated difference.
Returns
GetPrevious()
Creates a new ZonedDay instance by calculating the previous day.
[Pure]
public ZonedDay GetPrevious()
  Returns
GetWeek(IsoDayOfWeek)
Creates a new ZonedWeek instance that contains this instance.
[Pure]
public ZonedWeek GetWeek(IsoDayOfWeek weekStart = IsoDayOfWeek.Monday)
  Parameters
weekStartIsoDayOfWeekFirst day of the week.
Returns
GetYear()
Creates a new ZonedYear instance that contains this instance.
[Pure]
public ZonedYear GetYear()
  Returns
SetDayOfMonth(int)
Creates a new ZonedDay instance by setting the DayOfMonth component in this instance.
[Pure]
public ZonedDay SetDayOfMonth(int day)
  Parameters
dayintDay of month to set.
Returns
Exceptions
- ArgumentOutOfRangeException
 When
dayis not valid for the current month.
SetDayOfYear(int)
[Pure]
public ZonedDay SetDayOfYear(int day)
  Parameters
dayintDay of year to set.
Returns
Exceptions
- ArgumentOutOfRangeException
 When
dayis not valid for the current year.
SetMonth(IsoMonthOfYear)
[Pure]
public ZonedDay SetMonth(IsoMonthOfYear month)
  Parameters
monthIsoMonthOfYearMonth to set.
Returns
Remarks
Result may end up with modified components other than the month, if it lands in the range of invalid values of this instance's TimeZone.
SetYear(int)
[Pure]
public ZonedDay SetYear(int year)
  Parameters
yearintYear to set.
Returns
Remarks
Result may end up with modified components other than the year, if it lands in the range of invalid values of this instance's TimeZone.
Exceptions
- ArgumentOutOfRangeException
 When
yearis not valid.
Subtract(Period)
Creates a new ZonedDay instance by subtracting value from this instance.
[Pure]
public ZonedDay Subtract(Period value)
  Parameters
Returns
SubtractDays(int)
Creates a new ZonedDay instance by subtracting provided number of days from this instance.
[Pure]
public ZonedDay SubtractDays(int days)
  Parameters
daysintNumber of days to subtract.
Returns
ToBounds()
[Pure]
public Bounds<ZonedDateTime> ToBounds()
  Returns
- Bounds<ZonedDateTime>
 New Bounds<T> instance.
ToCheckedBounds()
Creates a new BoundsRange<T> instance from this instance's Start and End including any overlapping ambiguity.
[Pure]
public BoundsRange<ZonedDateTime> ToCheckedBounds()
  Returns
- BoundsRange<ZonedDateTime>
 New BoundsRange<T> instance.
ToLocalTimeZone()
[Pure]
public ZonedDay ToLocalTimeZone()
  Returns
ToString()
Returns a string representation of this ZonedDay instance.
[Pure]
public override string ToString()
  Returns
- string
 String representation.
ToTimeZone(TimeZoneInfo)
Creates a new ZonedDay in the targetTimeZone from this instance.
[Pure]
public ZonedDay ToTimeZone(TimeZoneInfo targetTimeZone)
  Parameters
targetTimeZoneTimeZoneInfoTarget time zone.
Returns
ToUtcTimeZone()
[Pure]
public ZonedDay ToUtcTimeZone()
  Returns
TryGetDateTime(TimeOfDay)
Attempts to create a new ZonedDateTime instance by setting the TimeOfDay component in this instance's Start date time.
[Pure]
public ZonedDateTime? TryGetDateTime(TimeOfDay timeOfDay)
  Parameters
timeOfDayTimeOfDayTime of day to set.
Returns
- ZonedDateTime?
 New ZonedDateTime instance or null when result is not valid in this instance's TimeZone.
Operators
operator +(ZonedDay, Period)
Creates a new ZonedDay instance by adding a and b together.
[Pure]
public static ZonedDay operator +(ZonedDay a, Period b)
  Parameters
Returns
operator ==(ZonedDay, ZonedDay)
Checks if a is equal to b.
[Pure]
public static bool operator ==(ZonedDay a, ZonedDay b)
  Parameters
Returns
- bool
 true when operands are equal, otherwise false.
explicit operator ZonedDateTime(ZonedDay)
Converts the provided source to ZonedDateTime.
[Pure]
public static explicit operator ZonedDateTime(ZonedDay source)
  Parameters
sourceZonedDayValue to convert.
Returns
explicit operator DateTime(ZonedDay)
Converts the provided source to DateTime.
[Pure]
public static explicit operator DateTime(ZonedDay source)
  Parameters
sourceZonedDayValue to convert.
Returns
operator >(ZonedDay, ZonedDay)
Checks if a is greater than b.
[Pure]
public static bool operator >(ZonedDay a, ZonedDay b)
  Parameters
Returns
- bool
 true when
ais greater thanb, otherwise false.
operator >=(ZonedDay, ZonedDay)
Checks if a is greater than or equal to b.
[Pure]
public static bool operator >=(ZonedDay a, ZonedDay b)
  Parameters
Returns
- bool
 true when
ais greater than or equal tob, otherwise false.
operator !=(ZonedDay, ZonedDay)
Checks if a is not equal to b.
[Pure]
public static bool operator !=(ZonedDay a, ZonedDay b)
  Parameters
Returns
- bool
 true when operands are not equal, otherwise false.
operator <(ZonedDay, ZonedDay)
Checks if a is less than b.
[Pure]
public static bool operator <(ZonedDay a, ZonedDay b)
  Parameters
Returns
- bool
 true when
ais less thanb, otherwise false.
operator <=(ZonedDay, ZonedDay)
Checks if a is less than or equal to b.
[Pure]
public static bool operator <=(ZonedDay a, ZonedDay b)
  Parameters
Returns
- bool
 true when
ais less than or equal tob, otherwise false.
operator -(ZonedDay, Period)
Creates a new ZonedDay instance by subtracting b from a.
[Pure]
public static ZonedDay operator -(ZonedDay a, Period b)