functx

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