Ler em inglês Editar

Compartilhar via


TimeOnly.Add Method

Definition

Overloads

Add(TimeSpan)

Returns a new TimeOnly that adds the value of the specified time span to the value of this instance.

Add(TimeSpan, Int32)

Returns a new TimeOnly that adds the value of the specified time span to the value of this instance. If the result wraps past the end of the day, this method returns the number of excess days as an out parameter.

Add(TimeSpan)

Source:
TimeOnly.cs
Source:
TimeOnly.cs
Source:
TimeOnly.cs

Returns a new TimeOnly that adds the value of the specified time span to the value of this instance.

public TimeOnly Add (TimeSpan value);

Parameters

value
TimeSpan

A positive or negative time interval.

Returns

An object whose value is the sum of the time represented by this instance and the time interval represented by value.

Applies to

.NET 9 e outras versões
Produto Versões
.NET 6, 7, 8, 9

Add(TimeSpan, Int32)

Source:
TimeOnly.cs
Source:
TimeOnly.cs
Source:
TimeOnly.cs

Returns a new TimeOnly that adds the value of the specified time span to the value of this instance. If the result wraps past the end of the day, this method returns the number of excess days as an out parameter.

public TimeOnly Add (TimeSpan value, out int wrappedDays);

Parameters

value
TimeSpan

A positive or negative time interval.

wrappedDays
Int32

When this method returns, contains the number of excess days, if any, that resulted from wrapping during this addition operation.

Returns

An object whose value is the sum of the time represented by this instance and the time interval represented by value.

Applies to

.NET 9 e outras versões
Produto Versões
.NET 6, 7, 8, 9