[#BloombergLP-bdlt-operator_minus-02]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::operator&hyphen;
:relfileprefix: ../../
:mrdocs:

Unary minus operators

== Synopses

Declared in `&lt;bdlt&lowbar;date&period;h&gt;`

Return a `DatetimeInterval` object whose value is the negative of the specified time interval `value`&period; The behavior is undefined unless `INT&lowbar;MIN &lt; value&period;days()`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlt/DatetimeInterval.adoc[bdlt::DatetimeInterval]
xref:BloombergLP/bdlt/operator_minus-01.adoc[operator&hyphen;](xref:BloombergLP/bdlt/DatetimeInterval.adoc[DatetimeInterval] const& value);
----

[.small]#xref:BloombergLP/bdlt/operator_minus-01.adoc[_» more&period;&period;&period;_]#

Return the date value that is earlier by the specified (signed) `numDays` from the specified `date`&period; The behavior is undefined unless the resulting value falls within the range of dates supported by this class (see `isValidYearMonthDay`)&period; Note that `numDays` may be negative&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlt/Date.adoc[bdlt::Date]
xref:BloombergLP/bdlt/operator_minus-09c.adoc[operator&hyphen;](
    xref:BloombergLP/bdlt/Date.adoc[Date] const& date,
    int numDays);
----

[.small]#xref:BloombergLP/bdlt/operator_minus-09c.adoc[_» more&period;&period;&period;_]#

Return the (signed) number of days between the specified `lhs` and `rhs` dates&period; Note that if `lhs &lt; rhs` the result will be negative&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:BloombergLP/bdlt/operator_minus-00f.adoc[operator&hyphen;](
    xref:BloombergLP/bdlt/Date.adoc[Date] const& lhs,
    xref:BloombergLP/bdlt/Date.adoc[Date] const& rhs);
----

[.small]#xref:BloombergLP/bdlt/operator_minus-00f.adoc[_» more&period;&period;&period;_]#

Return a `DatetimeInterval` object having a value that is the difference between the specified `lhs` (`Datetime`) and the specified `rhs` (`Datetime`)&period; If the `hour` attribute of either operand is 24, the result is the same as if that `hour` attribute is 0&period; The behavior is undefined unless the resulting value is in the valid range for a `DatetimeInterval` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlt/DatetimeInterval.adoc[bdlt::DatetimeInterval]
xref:BloombergLP/bdlt/operator_minus-0c.adoc[operator&hyphen;](
    xref:BloombergLP/bdlt/Datetime.adoc[Datetime] const& lhs,
    xref:BloombergLP/bdlt/Datetime.adoc[Datetime] const& rhs);
----

[.small]#xref:BloombergLP/bdlt/operator_minus-0c.adoc[_» more&period;&period;&period;_]#

Return a `Datetime` object having a value that is the difference between the specified `lhs` (`Datetime`) and the specified `rhs` (`DatetimeInterval`)&period; If `24 &equals;&equals; lhs&period;hour()`, the result is the same as if the `hour` attribute of `lhs` is 0&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlt/Datetime.adoc[bdlt::Datetime]
xref:BloombergLP/bdlt/operator_minus-07.adoc[operator&hyphen;](
    xref:BloombergLP/bdlt/Datetime.adoc[Datetime] const& lhs,
    xref:BloombergLP/bdlt/DatetimeInterval.adoc[DatetimeInterval] const& rhs);
----

[.small]#xref:BloombergLP/bdlt/operator_minus-07.adoc[_» more&period;&period;&period;_]#

Return a `Datetime` object having a value that is the difference between the specified `lhs` (`Datetime`) and the specified `rhs` (`bsls&colon;&colon;TimeInterval`)&period; If `24 &equals;&equals; lhs&period;hour()`, the result is the same as if the `hour` attribute of `lhs` is 0&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlt/Datetime.adoc[bdlt::Datetime]
xref:BloombergLP/bdlt/operator_minus-06.adoc[operator&hyphen;](
    xref:BloombergLP/bdlt/Datetime.adoc[Datetime] const& lhs,
    xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] const& rhs);
----

[.small]#xref:BloombergLP/bdlt/operator_minus-06.adoc[_» more&period;&period;&period;_]#

Return a `DatetimeInterval` object whose value is the difference between the specified `lhs` and `rhs` time intervals&period; The behavior is undefined unless the resulting time interval value is valid (i&period;e&period;, the days field must not overflow a 32&hyphen;bit integer)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlt/DatetimeInterval.adoc[bdlt::DatetimeInterval]
xref:BloombergLP/bdlt/operator_minus-0f.adoc[operator&hyphen;](
    xref:BloombergLP/bdlt/DatetimeInterval.adoc[DatetimeInterval] const& lhs,
    xref:BloombergLP/bdlt/DatetimeInterval.adoc[DatetimeInterval] const& rhs);
----

[.small]#xref:BloombergLP/bdlt/operator_minus-0f.adoc[_» more&period;&period;&period;_]#

Return a set containing the subtraction of the specified `rhs` set from the specified `lhs` set (i&period;e&period;, a set containing elements that are in `lhs`, but not in `rhs`)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlt/DayOfWeekSet.adoc[bdlt::DayOfWeekSet]
xref:BloombergLP/bdlt/operator_minus-0b.adoc[operator&hyphen;](
    xref:BloombergLP/bdlt/DayOfWeekSet.adoc[DayOfWeekSet] const& lhs,
    xref:BloombergLP/bdlt/DayOfWeekSet.adoc[DayOfWeekSet] const& rhs);
----

[.small]#xref:BloombergLP/bdlt/operator_minus-0b.adoc[_» more&period;&period;&period;_]#

Return the number of elements between specified `lhs` and `rhs`&period; The behavior is undefined unless `lhs` and `rhs` refer to codes associated with the same holiday in the same calendar&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ptrdiff&lowbar;t
xref:BloombergLP/bdlt/operator_minus-094.adoc[operator&hyphen;](
    xref:BloombergLP/bdlt/PackedCalendar_HolidayCodeConstIterator.adoc[PackedCalendar&lowbar;HolidayCodeConstIterator] const& lhs,
    xref:BloombergLP/bdlt/PackedCalendar_HolidayCodeConstIterator.adoc[PackedCalendar&lowbar;HolidayCodeConstIterator] const& rhs);
----

[.small]#xref:BloombergLP/bdlt/operator_minus-094.adoc[_» more&period;&period;&period;_]#

Return a `Time` value that is the difference between the specified `lhs` time and the specified `rhs` datetime interval&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlt/Time.adoc[bdlt::Time]
xref:BloombergLP/bdlt/operator_minus-03.adoc[operator&hyphen;](
    xref:BloombergLP/bdlt/Time.adoc[Time] const& lhs,
    xref:BloombergLP/bdlt/DatetimeInterval.adoc[DatetimeInterval] const& rhs);
----

[.small]#xref:BloombergLP/bdlt/operator_minus-03.adoc[_» more&period;&period;&period;_]#

Return a `DatetimeInterval` object initialized with the difference between the specified `lhs` and `rhs` time values&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlt/DatetimeInterval.adoc[bdlt::DatetimeInterval]
xref:BloombergLP/bdlt/operator_minus-003.adoc[operator&hyphen;](
    xref:BloombergLP/bdlt/Time.adoc[Time] const& lhs,
    xref:BloombergLP/bdlt/Time.adoc[Time] const& rhs);
----

[.small]#xref:BloombergLP/bdlt/operator_minus-003.adoc[_» more&period;&period;&period;_]#


[.small]#Created with https://www.mrdocs.com[MrDocs]#
