Take the 2-minute tour ×

This question already has an answer here:

How can we format the date in xslt ?


<xsl:value-of select ="name of function(I/P, 'MMM dd, yyyy')"/>

Thanks in advance...

share|improve this question

marked as duplicate by 0xA3, PaulG, andrewsi, nsfyn55, donfuxx Apr 17 at 4:07


add comment

2 Answers

up vote 6 down vote accepted

If you are using XSLT 1.0, you might find the date formatting features in EXSLT - Date and Times useful, in particular format-date. If you are using XSLT 2.0, you can use the built-in function described in Formatting Dates and Times.

share|improve this answer
add comment

This will probably help: ms:format-date Function

Using the example from the article you can format a date as follows:

Date Unedited: 2000-02-16T15:56:00

Date Edited: Feb 16, 2000

share|improve this answer
We had an error about "EnableScript". We were using some VB code, inside the XSLT to reformat the date. Since I couldn't apply the EnableScript flag on my XSLTs, they failed. Using the ms:format-date function, I was able to remove that code, and still nicely format my dates. –  Eric Burdo Mar 9 '13 at 19:58
add comment
