.. _functx_total-days-from-duration: =============================== functx:total-days-from-duration =============================== The total number of days in a dayTimeDuration Description ~~~~~~~~~~~ The functx:total-days-from-duration function returns the total number of days in $duration. If it is an uneven number of days, it will return a fractional part. This function is different from the built-in fn:days-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-days-from-duration(xs:dayTimeDuration('PT24H')) - 1 * - functx:total-days-from-duration(xs:dayTimeDuration('P1D')) - 1 * - functx:total-days-from-duration(xs:dayTimeDuration('PT36H')) - 1.5 * - functx:total-days-from-duration(xs:dayTimeDuration('PT48H')) - 2 In a generator ~~~~~~~~~~~~~~ Copy the snippet below and paste it in Freemapper, under a language node inside the ``generators`` element. Each line of the pattern prints the result of one example; to see them, run ``mi generate example-functx-total-days-from-duration``. .. code-block:: text :class: mi-trecho [e] example-functx-total-days-from-duration [e] start [e] match [v] / [e] body [e] write-pattern [v] examples [e] patterns [e] examples [v] E01: {{ functx:total-days-from-duration(xs:dayTimeDuration('PT24H')) }} [v] E02: {{ functx:total-days-from-duration(xs:dayTimeDuration('P1D')) }} [v] E03: {{ functx:total-days-from-duration(xs:dayTimeDuration('PT36H')) }} [v] E04: {{ functx:total-days-from-duration(xs:dayTimeDuration('PT48H')) }} See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`days-from-duration`. * :ref:`functx_total-seconds-from-duration`. * :ref:`functx_total-minutes-from-duration`. * :ref:`functx_total-hours-from-duration`. * :ref:`functx_total-months-from-duration`. * :ref:`functx_total-years-from-duration`.