开发者

Convert date from yyyy-mm-dd to dd-mm-yy using xsl

HI all, I got a JavaScript function to convert the date开发者_开发问答, but I was wondering if there is any way to convert the date with xsl without using JavaScript.

Thanks.


and the string manipulation, http://www.xml.com/pub/a/2002/05/01/xslt-string.html


Thanks to all of you for answering my question, after looking on those links you left me to take a look I came out with something very simple.

<xsl:for-each select="//MaternityDiaryEvent/DateOfVisit">
<xsl:value-of select="concat(substring(.,9,2),'/',substring(.,6,2),'/',substring(.,3,2))"/>
</xsl:for-each>

Thanks again to all, I'll give you a vote to each of you.

Cesar.


The format-date function might do the job.


You can use the Microsoft formatter.

Or the format-date function, if you are using XSLT 2.0 (which .Net does not).


Found a very good post on date formatting here.

No Javascript required. Only XSL elements and XPath String functions can do the job.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜