如何在xslt 2.0中解析字符串到日期 [英] How to parse string to date in xslt 2.0
本文介绍了如何在xslt 2.0中解析字符串到日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以将 30042013
(2013年4月30日)之间的字符串转换为日期格式?
Is it possible to convert strings like 30042013
(30 April 2013) to a date format?
所以我可以稍后在 format-date
推荐答案
< a href =http://www.w3.org/TR/xpath-functions/#func-dateTime =nofollow> fn:dateTime($ arg1 as xs:date?$ arg2 as xs:time?)
将其参数转换为 xs:dateTime
。
只需使用 fn:substring()
和 fn:concat()
删除相关部分,并将它们作为 yyyy-mm-dd
加入,然后传递到 fn:dateTime
。
Just use fn:substring()
and fn:concat()
to cut out the relevant parts and join them as yyyy-mm-dd
before passing that to fn:dateTime
.
这篇关于如何在xslt 2.0中解析字符串到日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文