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

Return the (signed fractional) number of years between the specified `beginDate` and `endDate`&period; If `beginDate &lt;&equals; endDate`, then the result is non&hyphen;negative&period; Note that reversing the order of `beginDate` and `endDate` negates the result&semi; specifically, `&verbar;yearsDiff(b, e) &plus; yearsDiff(e, b)&verbar; &lt;&equals; 1&period;0e&hyphen;15` for all dates `b` and `e`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
double
yearsDiff(
    xref:BloombergLP/bdlt/Date.adoc[bdlt::Date] const& beginDate,
    xref:BloombergLP/bdlt/Date.adoc[bdlt::Date] const& endDate) const = 0;
----


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