## 정의

지정된 시간 간격을 지정된 날짜 및 시간에 더하여 새로운 날짜와 시간을 얻습니다.Adds a specified time interval to a specified date and time, yielding a new date and time.

``````public:
static DateTime operator +(DateTime d, TimeSpan t);``````
``public static DateTime operator + (DateTime d, TimeSpan t);``
``static member ( + ) : DateTime * TimeSpan -> DateTime``
``Public Shared Operator + (d As DateTime, t As TimeSpan) As DateTime``

#### 매개 변수

d
DateTime DateTime DateTime DateTime

더할 날짜 및 시간 값입니다.The date and time value to add.

t
TimeSpan TimeSpan TimeSpan TimeSpan

더할 시간 간격입니다.The time interval to add.

#### 반환

`d` 값과 `t` 값의 합인 개체입니다.An object that is the sum of the values of `d` and `t`.

#### 예외

결과는 DateTimeMinValue보다 작거나 MaxValue보다 큽니다.The resulting DateTime is less than MinValue or greater than MaxValue.

## 예제

다음 예제에서는 더하기 연산자를 보여 줍니다.The following example demonstrates the addition operator.

``````System::DateTime dTime( 1980, 8, 5 );

// tSpan is 17 days, 4 hours, 2 minutes and 1 second.
System::TimeSpan tSpan( 17, 4, 2, 1 );

// Result gets 8/22/1980 4:02:01 AM.
System::DateTime result = dTime + tSpan;
``````
``````System.DateTime dTime = new System.DateTime(1980, 8, 5);

// tSpan is 17 days, 4 hours, 2 minutes and 1 second.
System.TimeSpan tSpan
= new System.TimeSpan(17, 4, 2, 1);

// Result gets 8/22/1980 4:02:01 AM.
System.DateTime result = dTime + tSpan;
``````
``````Dim dTime As Date = #8/5/1980#

' tSpan is 17 days, 4 hours, 2 minutes and 1 second.
Dim tSpan As New TimeSpan(17, 4, 2, 1)

Dim result1, result2 As Date

' Result gets 8/22/1980 4:02:01 AM.