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



Teradata.Client.Provider Namespace > TdIntervalDayToSecond Structure > TdIntervalDayToSecond Constructor : TdIntervalDayToSecond Constructor(Int32,Int32,Int32,Int32,Int32,Byte,Byte)
Number of days.
Number of hours.
Number of minutes.
Number of seconds.
The fractional number of seconds.
Number of significant digits of the day.
The number of decimal places for the second.
An instance of TdIntervalDayToSecond is created from a day and time components specified as integers while precision and scale components are specified as bytes.
Syntax
'Declaration
 
Public Function New( _
   ByVal days As Integer, _
   ByVal hours As Integer, _
   ByVal minutes As Integer, _
   ByVal seconds As Integer, _
   ByVal microseconds As Integer, _
   ByVal precision As Byte, _
   ByVal scale As Byte _
)
'Usage
 
Dim days As Integer
Dim hours As Integer
Dim minutes As Integer
Dim seconds As Integer
Dim microseconds As Integer
Dim precision As Byte
Dim scale As Byte
 
Dim instance As New TdIntervalDayToSecond(days, hours, minutes, seconds, microseconds, precision, scale)
public TdIntervalDayToSecond( 
   int days,
   int hours,
   int minutes,
   int seconds,
   int microseconds,
   byte precision,
   byte scale
)
public:
TdIntervalDayToSecond( 
   int days,
   int hours,
   int minutes,
   int seconds,
   int microseconds,
   byte precision,
   byte scale
)

Parameters

days
Number of days.
hours
Number of hours.
minutes
Number of minutes.
seconds
Number of seconds.
microseconds
The fractional number of seconds.
precision
Number of significant digits of the day.
scale
The number of decimal places for the second.
Exceptions
ExceptionDescription
The parameters specify 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 microsecond parameter is divided by 10^-6 (.000001) to create a fractional number of seconds. The supplied scale is used to used to truncate any fractional seconds at the position indicated by the scale.

For example, a microseconds value of 12345678 and a scale of 6 will be divided by 10^-6 and truncated at the 6th position resulting in a value of .123456. A microseconds value of 123 and a scale of 6 will result in a value of .000123.

All values are constructed into a TdIntervalDayToSecond to determine if the TdIntervalDayToSecond.MinValue or the TdIntervalDayToSecond.MaxValue values are exceeded. If the values are not exceeded but the resulting days component exceeds the supplied precision value, an exception is generated.

For example a constructor for TdIntervalDayToSecond(444, 4, 9, 2, 90, 2, 6) requests 444 days, 4 hours, 9 minutes, 2 seconds, 90 microseconds with a precision of 2 and a scale of 6. The resulting days value cannot be represented in 2 digits, therefore an exception is generated, even though the MinValue and the MaxValue values have not been exceeded.

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 TdIntervalDayToSecond. For instance, a day value of 200, an hour value of -4900, a minute value of 30, a second value of 400 and 1,200,510 microseconds will result in a TdIntervalDayToSecond interval value of -'4 03:23:18.799490'.

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

TdIntervalDayToSecond Structure
TdIntervalDayToSecond Members
Overload List