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



Teradata.Client.Provider Namespace > TdIntervalSecond Structure > TdIntervalSecond Constructor : TdIntervalSecond Constructor(TimeSpan,Byte,Byte)
A TimeSpan to initialize TdIntervalSecond.
Number of significant digits of the second.
The number of decimal places for the second.
An instance of TdIntervalSecond 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 TdIntervalSecond(timeSpan, precision, scale)
public TdIntervalSecond( 
   TimeSpan timeSpan,
   byte precision,
   byte scale
)
public:
TdIntervalSecond( 
   TimeSpan timeSpan,
   byte precision,
   byte scale
)

Parameters

timeSpan
A TimeSpan to initialize TdIntervalSecond.
precision
Number of significant digits of the second.
scale
The number of decimal places for the second.
Exceptions
ExceptionDescription
The timespan parameter specifies a TdIntervalSecond value less than TdIntervalSecond.MinValue or greater than TdIntervalSecond.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 seconds.
Remarks

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

After conversion of the TimeSpan value into a TdIntervalSecond, any fractional seconds will be truncated according the the supplied parameter scale.

For example, a TimeSpan value created with a TimeSpan.Ticks value of 8601234567 results in a value of 0 days, 0 hours, 14 minutes and 20.1234567 seconds. The TdIntervalSecond literal representation results in a TdIntervalSecond value of '860.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 3 and less than or equal to TdIntervalSecond.MaxScale to eliminate exceptions due to truncation of the seconds component.

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

TdIntervalSecond Structure
TdIntervalSecond Members
Overload List