【问题标题】:get difference in minutes in xslt 2.0 minutes-from-duration在 xslt 2.0 minutes-from-duration 中获得分钟差异
【发布时间】:2017-11-03 12:17:06
【问题描述】:

我必须约会:xs:date(current-date()) 和类似 2017-11-01T09:17:00Z 的东西。 我需要在几分钟内获得差异。

我的想法是使用minutes-from-duration() 函数,但我不知道如何将日期转换为正确的输入

【问题讨论】:

    标签: date xslt xslt-2.0 difference minute


    【解决方案1】:

    您可以简单地在 XSLT/XPath 2 或更高版本中减去两个日期或日期时间,例如current-dateTime() - xs:dateTime('2017-11-01T09:17:00Z') 获取持续时间,然后您可以使用您的函数或其他操作,例如(current-dateTime() - xs:dateTime('2017-11-01T09:17:00Z')) div xs:dayTimeDuration('PT1M') 将持续时间除以 1 分钟。

    【讨论】:

      猜你喜欢
      • 2013-11-24
      • 2016-02-11
      • 2018-11-08
      • 1970-01-01
      • 2016-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多