Last day of previous month in XSLT

时光毁灭记忆、已成空白 提交于 2020-01-15 07:35:21

问题


Is it possible to get the last day of the previous month in XSLT? I found this function: http://www.xsltfunctions.com/xsl/functx_last-day-of-month.html but I'm not sure how to use it to get the previous month.


回答1:


Use:

current-date()
  - xs:dayTimeDuration(concat('P', day-from-date(current-date()), 'D'))

This produces (when evaluated on any day of May 2012):

  2012-04-30-07:00


来源:https://stackoverflow.com/questions/10483246/last-day-of-previous-month-in-xslt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!