Struct DayTime
- Namespace
- Cavok
- Assembly
- Cavok.dll
A day of the month with a UTC time, as used for METAR observation times and TAF issue times
(for example 211125Z). Reports do not contain the month or year.
public readonly record struct DayTime : IEquatable<DayTime>
- Implements
- Inherited Members
Constructors
DayTime(int, int, int)
A day of the month with a UTC time, as used for METAR observation times and TAF issue times
(for example 211125Z). Reports do not contain the month or year.
public DayTime(int Day, int Hour, int Minute)
Parameters
DayintDay of the month, 1–31.
HourintHour, 0–23 (hour 24 only occurs in forecast periods, see DayHour).
MinuteintMinute, 0–59.
Properties
Day
Day of the month, 1–31.
public int Day { get; init; }
Property Value
Hour
Hour, 0–23 (hour 24 only occurs in forecast periods, see DayHour).
public int Hour { get; init; }
Property Value
Minute
Minute, 0–59.
public int Minute { get; init; }
Property Value
Methods
ToDateTimeOffset(DateTimeOffset)
Resolves the day and time to a full UTC timestamp. Of the months around reference
in which Day exists, the one giving the timestamp closest to reference
is used, so month and year boundaries are handled.
public DateTimeOffset ToDateTimeOffset(DateTimeOffset reference)
Parameters
referenceDateTimeOffsetA moment close to the report, typically the moment it was received.
Returns
- DateTimeOffset
The resolved UTC timestamp.
Exceptions
- ArgumentOutOfRangeException
Day is not between 1 and 31, or
reference(in UTC) lies in January or February of year 1 or in December 9999, so that a month around it falls outside the range of DateTimeOffset.