Send feedback on this topic.
Teradata.Client.Provider
Add(TimeSpan) Method



Teradata.Client.Provider Namespace > TdPeriodTime Structure > Add Method : Add(TimeSpan) Method
The TimeSpan that will be added.
The specified TimeSpan will be added to this instance of TdPeriodTime.
Syntax
'Declaration
 
Public Overloads Function Add( _
   ByVal timeSpan As TimeSpan _
) As TdPeriodTime
'Usage
 
Dim instance As TdPeriodTime
Dim timeSpan As TimeSpan
Dim value As TdPeriodTime
 
value = instance.Add(timeSpan)
public TdPeriodTime Add( 
   TimeSpan timeSpan
)
public:
TdPeriodTime Add( 
   TimeSpan timeSpan
) 

Parameters

timeSpan
The TimeSpan that will be added.

Return Value

A TdPeriodTime is returned that is the result of the TimeSpan added to this instance of TdPeriodTime.
Exceptions
ExceptionDescription
An invalid period will result in this operation.
Remarks

If this instance of TdPeriodTime is Null a TdPeriodTime.Null will be returned.

The only component of the TimeSpan object that will be considered is the time component. When this operation is performed, the time component of the TimeSpan is added to the this instance of TdPeriodTime. For example, if the period is "01:00:00, 01:30:00" and TimeSpan is "1.02:00:00.00" (1 day, 2 hours) the add operation will result in a period of (03:00:00, 03:30:00).

When adding a TimeSpan to a TdPeriodTime it is possible that the ending bound will roll into the next 24 hours, or the beginning bound will roll into the previous 24 hours. For example, suppose the period is

   (19:32:32.3404, 22:00:00.3232)

Adding the TimeSpan of "03:00:00" (3 hours) to the period will cause the ending bound to roll into the next 24 hours which will result in the invalid period:

    (22:32:32.3404, 01:00:00.3232)

Subtracting the TimeSpan of "20:00:00" (20 hours) to the same period will cause the beginning period to roll back into the previous 24 hours which results in the invalid period:

    (23:32:32.3404, 02:00:00.3232)

Refer to Period Arithmetic for additional information.

Requirements

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

See Also

Reference

TdPeriodTime Structure
TdPeriodTime Members
Overload List