Skip to content

Period.Subtract Method

Definition

Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll
Source: Period.cs

Subtract(Period, Period)

Subtracts one period from another, by simply subtracting each property value.

public static Period Subtract(Period minuend, Period subtrahend)

Parameters

Name Type Description
minuend Period The period to subtract the second operand from.
subtrahend Period The period to subtract the first operand from.

Returns

Period

The result of subtracting all the values in the second operand from the values in the first. The units of the result will be the union of both periods, even if the subtraction caused some properties to become zero (so "2 weeks, 1 days" minus "2 weeks" is "zero weeks, 1 days", not "1 days").

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue