.. _functx_total-years-from-duration: ================================ functx:total-years-from-duration ================================ The total number of years in a yearMonthDuration Description ~~~~~~~~~~~ The functx:total-years-from-duration function returns the total number of years in $duration. If it is an uneven number of years, it will return a fractional part. This function is different from the built-in fn:years-from-duration function because the latter will not return a fractional part. If $duration is the empty sequence, the empty sequence is returned. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - duration:time() - the duration Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - functx:total-years-from-duration(xs:yearMonthDuration('P18M')) - 1.5 * - functx:total-years-from-duration(xs:yearMonthDuration('P1Y')) - 1 * - functx:total-years-from-duration(xs:yearMonthDuration('P1Y6M')) - 1.5 See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`years-from-duration`. * :ref:`functx_total-seconds-from-duration`. * :ref:`functx_total-minutes-from-duration`. * :ref:`functx_total-hours-from-duration`. * :ref:`functx_total-days-from-duration`. * :ref:`functx_total-months-from-duration`.