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

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

== Synopsis

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

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

== Description

Return the (signed fractional) number of years between the specified `beginDate` and `endDate` according to the SIA 30&sol;360 end&hyphen;of&hyphen;month day&hyphen;count convention&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;

== Return Value

the signed fractional number of years between the dates

== Parameters

[cols="1,4"]
|===
| Name| Description
| *beginDate*
| start of the date range
| *endDate*
| end of the date range
|===


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