Link to home
Start Free TrialLog in
Avatar of PuneetKSaxena
PuneetKSaxena

asked on

Change date format in xslt

Hi,

I'm using xslt to display date from xml
In xml the date is like "2009-02-11T15:55:20.283-08:00" , which i'm reading from xsl.
I want to change the format of date to "02-11-2009" in xsl.


How can i do that

Thanks and Regards
Puneet
XML:
 
<a>
<b id="1">
  <date>2009-02-11T15:55:20.283-08:00</date>
</b>
<b id="2">
  <date>2009-02-21T10:55:20.283-08:00</date>
</b>
 
 
and my xsl is 
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8"/>
<xsl:template match="/">
<html>
<head><title>Oa</title><link rel="stylesheet" type="text/css" />
</head>
<body  bgcolor="#808080">
<TR>
<xsl:for-each select="a/b">
<TD width="10%" align="center"><xsl:value-of select="date"/></TD> 
</TR>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PuneetKSaxena
PuneetKSaxena

ASKER

Thats perfect.

Thanks a lot