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



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

Parameters

timeSpan
The TimeSpan that will be subtracted.

Return Value

A TdPeriodTimeWithTimeZone is returned that is the result of the TimeSpan subtracted from this instance of TdPeriodTimeWithTimeZone.
Exceptions
ExceptionDescription
An invalid period will result in this operation.
Remarks

If this instance of TdPeriodTimeWithTimeZone is Null a TdPeriodTimeWithTimeZone.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 subtracted from this instance of TdPeriodTimeWithTimeZone. For example, if the period is "05:00:00-08:00, 06:30:00-08:00" and TimeSpan is "1.02:00:00.00" (1 day, 2 hours) the subtract operation will result in a period of (03:00:00-08:00, 04:30:00-08:00).

When subtracting a TimeSpan from a TdPeriodTimeWithTimeZone 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-08:00, 22:00:00.3232-08:00)

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

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

Subtracting the TimeSpan of "-3:00:00" (-3 hours) from 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-08:00, 01:00:00.3232-08:00)

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

TdPeriodTimeWithTimeZone Structure
TdPeriodTimeWithTimeZone Members
Overload List