.. _functx_total-months-from-duration: ================================= functx:total-months-from-duration ================================= The total number of months in a yearMonthDuration Description ~~~~~~~~~~~ The functx:total-months-from-duration function returns the total number of months in $duration. This function is different from the built-in fn:months-from-duration function because the latter will normalize the value and only give you the remainder number of months between 1 and 12. For example, fn:months-from-duration(xs:yearMonthDuration("P18M")) will return 6, while functx:total-months-from-duration(xs:yearMonthDuration("P18M")) will return 18. 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-months-from-duration(xs:yearMonthDuration('P18M')) - 18 * - functx:total-months-from-duration(xs:yearMonthDuration('P1Y')) - 12 * - functx:total-months-from-duration(xs:yearMonthDuration('P1Y6M')) - 18 See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`months-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-years-from-duration`.