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



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

Parameters

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

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

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

For example, a TimeSpan value created with a TimeSpan.Ticks value of 8726341234567 results in a value of 10 days, 2 hours, 23 minutes, and 54.1234567 seconds. The TdIntervalDayToSecond literal representation results in a TdIntervalDayToSecond value of '10 02:23.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, to eliminate an exceptions due to truncation of the days component.

Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdIntervalDayToSecond Structure
TdIntervalDayToSecond Members
Overload List