Send feedback on this topic.
Teradata.Client.Provider
TdIntervalHour Constructor(TimeSpan,Byte)



Teradata.Client.Provider Namespace > TdIntervalHour Structure > TdIntervalHour Constructor : TdIntervalHour Constructor(TimeSpan,Byte)
A TimeSpan to initialize TdIntervalHour.
Number of significant digits of the hour.
An instance of TdIntervalHour is created using a TimeSpan specifying the hour precision as a byte.
Syntax
'Declaration
 
Public Function New( _
   ByVal timeSpan As TimeSpan, _
   ByVal precision As Byte _
)
'Usage
 
Dim timeSpan As TimeSpan
Dim precision As Byte
 
Dim instance As New TdIntervalHour(timeSpan, precision)
public TdIntervalHour( 
   TimeSpan timeSpan,
   byte precision
)
public:
TdIntervalHour( 
   TimeSpan timeSpan,
   byte precision
)

Parameters

timeSpan
A TimeSpan to initialize TdIntervalHour.
precision
Number of significant digits of the hour.
Exceptions
ExceptionDescription
The timespan parameter specifies a TdIntervalHour value less than TdIntervalHour.MinValue or greater than TdIntervalHour.MaxValue.
The precision parameter is outside the TdIntervalHour.MinPrecision or TdIntervalHour.MaxPrecision range of values.
The precision parameter is not large enough to represent the number of hours.
Remarks

The TimeSpan value is converted into a TdIntervalHour and evaluated against TdIntervalHour.MinValue and TdIntervalHour.MaxValue. If the values are not exceeded but the resulting hours component exceeds the supplied parameter precision value, an exception is generated.

After conversion of the TimeSpan value into a TdIntervalHour, any minutes, seconds or microseconds will be truncated. For example, a TimeSpan value created with a TimeSpan.Ticks value of 9378401234567 results in a value of 10 days, 20 hours, 30 minutes and 40.1234567 seconds. The TdIntervalHour literal representation results in a TdIntervalHour value of '260'. The 30 minutes and the 40.1234567 seconds values are truncated.

Requirements
ProductVersionsPlatforms
.NET2.1, 3.1, 6Windows, Linux, MacOS
.NET Framework4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8Windows
.NET Standard2.0Windows, Linux, MacOS
See Also

Reference

TdIntervalHour Structure
TdIntervalHour Members
Overload List