## Definición

Devuelve un nuevo objeto DateTime que suma el valor del objeto TimeSpan especificado al valor de esta instancia.Returns a new DateTime that adds the value of the specified TimeSpan to the value of this instance.

``````public:
``public DateTime Add (TimeSpan value);``
``member this.Add : TimeSpan -> DateTime``
``Public Function Add (value As TimeSpan) As DateTime``

#### Parámetros

value
TimeSpan

Intervalo de tiempo positivo o negativo.A positive or negative time interval.

#### Devoluciones

DateTime

Objeto cuyo valor es la suma de la fecha y hora representadas por esta instancia y el intervalo de hora representado por `value`.An object whose value is the sum of the date and time represented by this instance and the time interval represented by `value`.

#### Excepciones

El DateTime resultante es menor que MinValue o mayor que MaxValue.The resulting DateTime is less than MinValue or greater than MaxValue.

## Ejemplos

En el siguiente ejemplo se muestra el Add método.The following example demonstrates the Add method. Calcula el día de la semana que es 36 días (864 horas) a partir de este momento.It calculates the day of the week that is 36 days (864 hours) from this moment.

``````// Calculate what day of the week is 36 days from this instant.
System::DateTime today = System::DateTime::Now;
System::TimeSpan duration( 36, 0, 0, 0 );
``````
``````// Calculate what day of the week is 36 days from this instant.
System.DateTime today = System.DateTime.Now;
System.TimeSpan duration = new System.TimeSpan(36, 0, 0, 0);
``````
``````' Calculate what day of the week is 36 days from this instant.
Dim today As System.DateTime
Dim duration As System.TimeSpan

today = System.DateTime.Now
duration = New System.TimeSpan(36, 0, 0, 0)