XSL custom format DateTime column
-
28 มิถุนายน 2555 7:58
Hi experts, is there a way to custom format datetime column to dd MMM yy. The best possible solution I made by far is this:
<xsl:value-of select="ddwrt:FormatDate(string(@Dated),2057,3)"/>
Output: 23 January 2012
Sample source:
http://blogs.msdn.com/b/joshuag/archive/2009/03/25/custom-date-formats-in-sharepoint-xsl.aspx
Appreciate any ideas to suggest.
Cheers, R2C3 ----------------------------------- starting sharepoint :)
ตอบทั้งหมด
-
28 มิถุนายน 2555 11:49
Try this <xsl:value-of select="ddwrt:FormatDateTime(string(@Dated), 1033 , 'dd-MMM-yyyy')" />
Also refer to the following articles
http://msdn.microsoft.com/en-us/library/ms256099.aspx
http://sharepointnuke.blogspot.in/2010/07/xslt-date-format-dd-mmm-yyyy-using.html
--Cheers
-
1 กรกฎาคม 2555 11:27@Prasath C thanks work a magic.
Cheers, R2C3 ----------------------------------- starting sharepoint :)
-
1 กรกฎาคม 2555 13:51
Good to know that it worked, but, you should be marking the post as answer which helped you to resolve your problem, not your reply for that :-)
--Cheers
- แก้ไขโดย Prasath C 2 กรกฎาคม 2555 4:35
-
2 กรกฎาคม 2555 7:41
Just found this out, the entry is 02 July 2012 but when it shows in DVWP with xsl formatting it shows 07 Feb 2012.
Cheers, R2C3 ----------------------------------- starting sharepoint :)
-
2 กรกฎาคม 2555 8:36
Seems like the format of input date needs to be converted, refer to the following posts
http://amavs.wordpress.com/tag/formatdatetime/
http://social.technet.microsoft.com/Forums/is/sharepoint2010customization/thread/96ed2353-f9c2-41d4-82f5-eac8954d45bb
--Cheers
-
2 กรกฎาคม 2555 9:23
Thanks again. Ill take the lead from here. :)Cheers, R2C3 ----------------------------------- starting sharepoint :)
- ทำเครื่องหมายเป็นคำตอบโดย R2C3 2 กรกฎาคม 2555 9:23