xslt date format change (dd-mmm-yyyy) -
i using below code show current date in xslt program.it's working fine date format yyyy-mm-dd. need format dd-mmm-yyyy. please me this.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns:cs="urn:cs" > <xsl:value-of select="cs:datenow()"></xsl:value-of>
you have tagged question xslt 2.0 expect current date current-date
function http://www.w3.org/tr/xpath-functions/#func-current-date , format xslt 2.0 function format-date
http://www.w3.org/tr/xslt20/#format-date. format-date(current-date(), '[d01]-[mn,*-3]-[y0001]')
gives format 11-jul-2013
. depending on needs (i not sure format mmm
stands for, date formatting routines define own patterns) need adapt "picture string" argument of format-date
, see documentation linked to.
Comments
Post a Comment