CalendarDateTime Struct
A date or a date and time of an iCalendar object: a date (VALUE=DATE), a time in UTC (Z), a local time in a time zone (TZID), or a floating time.
public readonly struct CalendarDateTime : IEquatable<CalendarDateTime>- Implements
Constructors
| Name | Description |
|---|---|
| CalendarDateTime(DateTime, string?, bool) | Creates a date and time. |
CalendarDateTime(DateTime, string?, bool)
CalendarDateTime.csCreates a date and time.
Parameters
valueDateTime- The value: in UTC when its kind is
DateTimeKind.Utc, a local time otherwise. timeZoneIdstring?- The identifier of the time zone of a local time (
TZID), ornullfor a time in UTC or a floating time. isDatebool- Whether the value is a date, without a time.
Properties
| Name | Description |
|---|---|
| IsDate | Gets whether the value is a date, without a time (an all-day event). |
| IsUtc | Gets whether the value is in UTC. |
| TimeZoneId | Gets the identifier of the time zone of a local time, or null. |
| Value | Gets the value. |
IsDate
CalendarDateTime.csIsUtc
CalendarDateTime.csTimeZoneId
CalendarDateTime.csValue
CalendarDateTime.csMethods
| Name | Description |
|---|---|
| Equals(CalendarDateTime) | |
| Equals(object) | |
| FromDate(DateOnly) | Creates a date. |
| FromUtc(DateTime) | Creates a time in UTC. |
| GetHashCode() | |
| Parse(ContentLine) | Reads the value of a property: its value, and its parameters VALUE and TZID. |
| Parse(string, string?) | Reads a date or a date and time. |
| ToString() | Returns the value as it is written in a property. |
| ToUtc(VCalendar?) | Returns the value in UTC: a time in UTC as it is, a local time with the definition of its time zone in the calendar (VTIMEZONE). A date is midnight in UTC. |
Equals overloads
Equals(CalendarDateTime)
public bool Equals(CalendarDateTime other)No documentation is available.
Equals(object)
FromDate(DateOnly)
CalendarDateTime.csCreates a date.
public static CalendarDateTime FromDate(DateOnly date)FromUtc(DateTime)
CalendarDateTime.csCreates a time in UTC.
public static CalendarDateTime FromUtc(DateTime value)Parameters
valueDateTime- The time; a time that is not in UTC is converted.
Returns
CalendarDateTime The time.
GetHashCode()
Parse overloads
Parse(ContentLine)
CalendarDateTime.csReads the value of a property: its value, and its parameters VALUE and TZID.
public static CalendarDateTime? Parse(ContentLine line)Parameters
lineContentLine- The property.
Returns
CalendarDateTime? The value, or null when it is not a date or a date and time.
Parse(string, string?)
CalendarDateTime.csReads a date or a date and time.
public static CalendarDateTime? Parse(string value, string? timeZoneId = null)Parameters
valuestring- The value, such as
20260115,20260115T090000Zor20260115T090000. timeZoneIdstring?- The identifier of the time zone of a local time.
Returns
CalendarDateTime? The value, or null when it is not a date or a date and time.
ToString()
CalendarDateTime.csToUtc(VCalendar?)
CalendarDateTime.csReturns the value in UTC: a time in UTC as it is, a local time with the definition of its time zone in the calendar (VTIMEZONE). A date is midnight in UTC.
Parameters
calendarVCalendar?- The calendar that defines the time zones, or
null.
Returns
DateTime? The time in UTC, or null for a floating time or a time zone the calendar does not define.
Operators
| Name | Description |
|---|---|
| operator ==(CalendarDateTime, CalendarDateTime) | |
| operator !=(CalendarDateTime, CalendarDateTime) |
operator ==(CalendarDateTime, CalendarDateTime)
public static bool operator ==(CalendarDateTime left, CalendarDateTime right)No documentation is available.
operator !=(CalendarDateTime, CalendarDateTime)
public static bool operator !=(CalendarDateTime left, CalendarDateTime right)No documentation is available.