Struct GribTimeRange
A GRIB2 time range: a count of a unit from code table 4.4, for example a forecast time of 3 hours.
public readonly record struct GribTimeRange : IEquatable<GribTimeRange>
- Implements
- Inherited Members
Constructors
GribTimeRange(GribTimeUnit, int)
A GRIB2 time range: a count of a unit from code table 4.4, for example a forecast time of 3 hours.
public GribTimeRange(GribTimeUnit Unit, int Value)
Parameters
UnitGribTimeUnitThe unit.
ValueintThe number of units; may be negative (a forecast time before the reference time).
Properties
Unit
The unit.
public GribTimeUnit Unit { get; init; }
Property Value
Value
The number of units; may be negative (a forecast time before the reference time).
public int Value { get; init; }
Property Value
Methods
AddTo(DateTime)
Adds the range to time, calendar-aware for months and longer units.
public DateTime AddTo(DateTime time)
Parameters
timeDateTimeThe time to start from, usually the reference time.
Returns
Exceptions
- UnsupportedGribException
The unit isn't one of code table 4.4's defined units.
ToString()
Returns the range as, for example, "3 h".
public override string ToString()