Finding the difference between 2 dates in xslt

前端 未结 3 1793
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-09 13:20

Is there a less then kludgey way of finding the difference in days between 2 dates in xslt? If so can you point me in the right direction. I am receiving dates in the format

3条回答
  •  無奈伤痛
    2020-12-09 13:45

    This could be easily done using the following expression:

    days-from-duration(xs:date('yyyy-MM-dd')-xs:date('yyyy-MM-dd'))
    

    For example:

    days-from-duration(xs:date('2012-06-30')-xs:date('2012-06-18')) 
    

    will give result of 12

提交回复
热议问题