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



Teradata.Client.Provider Namespace > TdIntervalHourToSecond Structure > TdIntervalHourToSecond Constructor : TdIntervalHourToSecond Constructor(TimeSpan,Byte,Byte)
A TimeSpan to initialize TdIntervalHourToSecond.
The number of significant digits of the hour.
The number of decimal places for the second.
An instance of TdIntervalHourToSecond is created using a TimeSpan specifying the precision and the scale as bytes.
Syntax
'Declaration
 
Public Function New( _
   ByVal timeSpan As TimeSpan, _
   ByVal precision As Byte, _
   ByVal scale As Byte _
)
'Usage
 
Dim timeSpan As TimeSpan
Dim precision As Byte
Dim scale As Byte
 
Dim instance As New TdIntervalHourToSecond(timeSpan, precision, scale)
public TdIntervalHourToSecond( 
   TimeSpan timeSpan,
   byte precision,
   byte scale
)
public:
TdIntervalHourToSecond( 
   TimeSpan timeSpan,
   byte precision,
   byte scale
)

Parameters

timeSpan
A TimeSpan to initialize TdIntervalHourToSecond.
precision
The number of significant digits of the hour.
scale
The number of decimal places for the second.
Exceptions
ExceptionDescription
The timespan parameter specifies a TdIntervalHourToSecond value less than TdIntervalHourToSecond.MinValue or greater than TdIntervalHourToSecond.MaxValue.
The precision or scale parameters are outside the minimum or maximum range of values.
The precision parameter is not large enough to represent the number of hours.
Remarks

The TimeSpan value is converted into a TdIntervalHourToSecond and evaluated against TdIntervalHourToSecond.MinValue and TdIntervalHourToSecond.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 TdIntervalHourToSecond, any fractional seconds will be truncated according the the supplied parameter scale.

For example, a TimeSpan value created with a TimeSpan.Ticks value of 368601234567 results in a value of 0 days, 10 hours, 14 minutes and 20.1234567 seconds. The TdIntervalHourToSecond literal representation results in a TdIntervalHourToSecond value of '10:14:20.123456'. The .1234567 seconds value will truncated by the supplied parameter scale. The supplied parameter precision must be a value greater than or equal to 2 and less than or equal to TdIntervalHourToSecond.MaxScale to eliminate exceptions due to truncation of the minutes component.

Requirements

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

See Also

Reference

TdIntervalHourToSecond Structure
TdIntervalHourToSecond Members
Overload List