'Usage Dim years As Integer Dim precision As Byte Dim instance As New TdIntervalYear(years, precision)
Parameters
- years
- Number of years.
- precision
- Number of significant digits of the year.
'Usage Dim years As Integer Dim precision As Byte Dim instance As New TdIntervalYear(years, precision)
Exception | Description |
---|---|
OverflowException | The years parameter specifies a TdIntervalYear value less than TdIntervalYear.MinValue or greater than TdIntervalYear.MaxValue. |
ArgumentOutOfRangeException | The precision parameter is less than the TdIntervalYear.MinPrecision or greater than the TdIntervalYear.MaxPrecision range of values. |
ArgumentException | The precision parameter is not large enough to represent the number of years. |
The allowable values of precision are from 1 to 4.
The number of years is evaluated against TdIntervalYear.MinValue and and TdIntervalYear.MaxValue to determine if the values are exceeded. If the values are not exceeded but the resulting years component exceeds the supplied precision value, an exception is generated.
For example, a year value of 99 and a precision of 1 will generate an exception. The TdIntervalYear.Years interval component cannot be represented in 1 significant digit, thus resulting in an invalid TdIntervalYear.
Negative years may be supplied to represent negative duration of time.
Target Platforms: Windows 7, Windows 8, Windows 8.1, Windows 10, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2