.. _functx_yearMonthDuration: ======================== functx:yearMonthDuration ======================== Construct a yearMonthDuration from a number of years and months Description ~~~~~~~~~~~ The functx:yearMonthDuration function constructs an xs:yearMonthDuration value from two arguments representing a number of years and a number of months. Zero can be represented either by the number 0 or the empty sequence. If both arguments are zero or the empty sequence, it returns P0M. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - years:numeric() - the number of years * - months:integer() - the number of months Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - functx:yearMonthDuration(1,6) - P1Y6M * - functx:yearMonthDuration(1.5,0) - P1Y6M * - functx:yearMonthDuration(1,()) - P1Y * - functx:yearMonthDuration(1,0) - P1Y * - functx:yearMonthDuration(-1,-3) - -P1Y3M * - functx:yearMonthDuration(-1,3) - -P9M * - functx:yearMonthDuration(0,0) - P0M Depends On ~~~~~~~~~~ * :ref:`functx_if-empty`. See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`functx_dayTimeDuration`.