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



Teradata.Client.Provider Namespace > TdIntervalSecond Structure > TdIntervalSecond Constructor : TdIntervalSecond Constructor(Int32,Int32)
Number of seconds.
The number of fractional seconds.
An instance of TdIntervalSecond is created from the time components specified as integers.
Syntax
'Declaration
 
Public Function New( _
   ByVal seconds As Integer, _
   ByVal microseconds As Integer _
)
'Usage
 
Dim seconds As Integer
Dim microseconds As Integer
 
Dim instance As New TdIntervalSecond(seconds, microseconds)
public TdIntervalSecond( 
   int seconds,
   int microseconds
)
public:
TdIntervalSecond( 
   int seconds,
   int microseconds
)

Parameters

seconds
Number of seconds.
microseconds
The number of fractional seconds.
Exceptions
ExceptionDescription
The parameters specify a TdIntervalSecond value less than TdIntervalSecond.MinValue or greater than TdIntervalSecond.MaxValue.
Remarks

The number of seconds and microseconds are constructed into a TdIntervalSecond and evaluated against TdIntervalSecond.MinValue and TdIntervalSecond.MaxValue. The microseconds parameter represents 10 ^-6 seconds and the microsecond parameter is divided by 10^-6 (.000001) to create a fractional number of seconds. The TdIntervalSecond.Scale is then calculated from the number of fractional seconds required. The TdIntervalSecond.Precision is calculated from the number of digits contained within the interval second component.

For example 300 seconds and 455666 microseconds is first constructed into a TdIntervalSecond and evaluated against MinValue and MaxValue. The TdIntervalSecond literal representation results in a TdIntervalSecond value of '300.455666'. Precision is calculated to be a value of 3 representing three significant digits in 300 seconds. The scale is calculated to be 6 from the number of decimal places right of the seconds interval which equals the TdIntervalSecond.MaxScale value.

Negative constructor parameters may be supplied to represent negative durations of time. Mixed positive and negative constructor parameters are added together that result in a negative or positive TdIntervalSecond. For instance, a second value of -4900, and a microsecond value of 30 will result in a TdIntervalSecond interval value of -'4899.000070' with a calculated precision of 4 and a calculated scale of 6.

Requirements

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

See Also

Reference

TdIntervalSecond Structure
TdIntervalSecond Members
Overload List