xslt格式化日期和时间:使用ms:format-date、ms:format-time
现在xslt中声明<xsl:stylesheet version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:SharePoint="Microsoft.Sharepoint.WebControls">
示例日期格式如:2009-01-20 12:38:41
<xsl:value-of select="ms:format-date(substring-before(Created,' '), 'dddd, MMMM, yyyy.')"/>
属性:http://msdn.microsoft.com/en-us/library/ms256099.aspx
结果:Tuesday, January, 2009.
<xsl:value-of select="ms:format-time(substring-after(Created,' '), ' hh:mm tt')"/>
属性:http://msdn.microsoft.com/en-us/library/ms256467.aspx
结果:12:38 PM