Knowledge Walls
Gopal Rao
Mumbai, Maharashtra, India
Passcode:
How to format the Date in XSLT-sharepoint
6976 Views
Introduction 
Here i explained about how to format the date in XSLT by using ddwrt namespace
Add this in your xsl:stylesheet which i background with yellow colour 
<xsl:stylesheet 
  version="1.0" 
  xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
 
when you are select the date column in xsl use the following format
While select the column use code-shown below
Syntax:
<xsl:value-of select="ddwrt:FormatDateTime(string(column_name),locale,format)" />
Different format and locale numbers are available to get various Date format. Search it in internet.
<xsl:value-of select="ddwrt:FormatDate(@PublishedDate,1033,15)"/>
Output: Wednesday, December 01, 2013 12:00:00 PM
And also you can format with string function shown below.
<xsl:value-of select="ddwrt:FormatDateTime(string(@PublishedDate),1033,'dd MMM, yyyy')" />
Output : 13 Nov, 2013
Next
Best Lessons of "Sharepoint(MOSS) XSLT codes"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details