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



Teradata.Client.Provider Namespace > TdIntervalHourToSecond Structure > TdIntervalHourToSecond Constructor : TdIntervalHourToSecond Constructor(Int32,Int32,Int32,Int32,Byte,Byte)
Number of hours.
Number of minutes.
Number of seconds.
The fractional number of seconds.
Number of significant digits of the hour.
The number of decimal places for the second.
An instance of TdIntervalHourToSecond is created from time components specified as integers while precision and scale components are specified as bytes.
Syntax
'Declaration
 
Public Function New( _
   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 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 TdIntervalHourToSecond(hours, minutes, seconds, microseconds, precision, scale)
public TdIntervalHourToSecond( 
   int hours,
   int minutes,
   int seconds,
   int microseconds,
   byte precision,
   byte scale
)
public:
TdIntervalHourToSecond( 
   int hours,
   int minutes,
   int seconds,
   int microseconds,
   byte precision,
   byte scale
)

Parameters

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 hour.
scale
The number of decimal places for the second.
Exceptions
ExceptionDescription
The parameters specify 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 number of hours, minutes, seconds and microseconds are constructed into a TdIntervalHourToSecond. 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 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 converted into a TdIntervalHourToSecond to determine if the TdIntervalHourToSecond.MinValue or the TdIntervalHourToSecond.MaxValue values are exceeded. If the values are not exceeded but the resulting hours component exceeds the supplied precision value, an exception is generated.

For example a constructor for TdIntervalHourToSecond(44, 6001, 10, 90, 2, 6) requests 44 hours, 6001 minutes, 10 seconds and 90 microseconds with a precision of 2 and a scale of 6. The resulting TdIntervalHourToSecond literal value of '144:01:10.000090' contains an hours value which 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 TdIntervalHourToSecond. For instance, an hour value of 20, a minutes value of -4900, a seconds value of 30, a microsecond value of 123456, a second precision of 4 and a scale of 6 will result in a TdIntervalHourToSecond interval value of -'61:40:30.123456'.

Requirements
ProductVersionsPlatforms
.NET6, 7Windows, Linux, MacOS
.NET Framework4.6.2, 4.7, 4.7.1, 4.7.2, 4.8Windows
.NET Standard2.0Windows, Linux, MacOS
See Also

Reference

TdIntervalHourToSecond Structure
TdIntervalHourToSecond Members
Overload List