DateTime.opBinary

DateTime opBinary(string op)(Duration duration) if (op == "+" || op == "-") const @safe pure nothrow @nogc

Gives the result of adding or subtracting a Duration from this DateTime.

The legal types of arithmetic for DateTime using this operator are

DateTime + Duration --> DateTime
DateTime - Duration --> DateTime
Duration + DateTime --> DateTime

Parameters

durationThe Duration to add to or subtract from this DateTime.
Duration opBinary(string op)(DateTime rhs) if (op == "-") const @safe pure nothrow @nogc

Gives the difference between two DateTimes.

The legal types of arithmetic for DateTime using this operator are

DateTime - DateTime --> duration