I have a Date coming from SQL 2010-05-11 10:30:00 But when i applyc XSL it is adding the 2010-05-11T10:30:00-04:00 time zone offset. Is there any way we can remove that from XSL.
+1
A:
Use substring to format?
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" />
<xsl:template match="*">
<xsl:copy>
<xsl:for-each select="@*">
<xsl:copy-of select="." />
</xsl:for-each>
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
<xsl:template match="MyMessage/DateField">
<xsl:copy>
<xsl:value-of select="substring(.,1,4)"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="substring(.,5,2)"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="substring(.,7,2)"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
oluies
2010-05-19 22:23:24