[#BloombergLP-bbldc-PeriodDayCountUtil-yearsDiff-06]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bbldc.adoc[bbldc]::xref:BloombergLP/bbldc/PeriodDayCountUtil.adoc[PeriodDayCountUtil]::yearsDiff
:relfileprefix: ../../../
:mrdocs:

`yearsDiff` overloads

== Synopses

Declared in `&lt;bbldc&lowbar;perioddaycountutil&period;h&gt;`

Return the (signed fractional) number of years between two dates&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
double
xref:BloombergLP/bbldc/PeriodDayCountUtil/yearsDiff-0f.adoc[yearsDiff](
    xref:BloombergLP/bdlt/Date.adoc[bdlt::Date] const& beginDate,
    xref:BloombergLP/bdlt/Date.adoc[bdlt::Date] const& endDate,
    xref:bsl/vector-00d.adoc[bsl::vector&lt;bdlt::Date&gt;] const& periodDate,
    double periodYearDiff,
    xref:BloombergLP/bbldc/DayCountConvention/Enum.adoc[DayCountConvention::Enum] convention);
----

[.small]#xref:BloombergLP/bbldc/PeriodDayCountUtil/yearsDiff-0f.adoc[_» more&period;&period;&period;_]#

See the corresponding `bsl&colon;&colon;vector` overload above&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
double
xref:BloombergLP/bbldc/PeriodDayCountUtil/yearsDiff-05.adoc[yearsDiff](
    xref:BloombergLP/bdlt/Date.adoc[bdlt::Date] const& beginDate,
    xref:BloombergLP/bdlt/Date.adoc[bdlt::Date] const& endDate,
    std::pmr::vector&lt;bdlt::Date&gt; const& periodDate,
    double periodYearDiff,
    xref:BloombergLP/bbldc/DayCountConvention/Enum.adoc[DayCountConvention::Enum] convention);
----

[.small]#xref:BloombergLP/bbldc/PeriodDayCountUtil/yearsDiff-05.adoc[_» more&period;&period;&period;_]#

See the corresponding `bsl&colon;&colon;vector` overload above&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
double
xref:BloombergLP/bbldc/PeriodDayCountUtil/yearsDiff-03.adoc[yearsDiff](
    xref:BloombergLP/bdlt/Date.adoc[bdlt::Date] const& beginDate,
    xref:BloombergLP/bdlt/Date.adoc[bdlt::Date] const& endDate,
    std::vector&lt;bdlt::Date&gt; const& periodDate,
    double periodYearDiff,
    xref:BloombergLP/bbldc/DayCountConvention/Enum.adoc[DayCountConvention::Enum] convention);
----

[.small]#xref:BloombergLP/bbldc/PeriodDayCountUtil/yearsDiff-03.adoc[_» more&period;&period;&period;_]#

== Return Value

signed fractional year difference according to `convention`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *beginDate*
| start of the date range
| *endDate*
| end of the date range
| *periodDate*
| sorted unique period&hyphen;boundary dates
| *periodYearDiff*
| year fraction of each period
| *convention*
| day&hyphen;count convention to apply
|===


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