SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have SharePoint 2010 calendar and I am opening it as DataFormwebpart in SharePoint Designer and I noticed EndDate as follows: xsl:value-of select="@EndDate"/ and the result is 2012-03-15T14:30:00Z

How can I modify the xsl:value-of select="@EndDate"/ to Show DateTime as follows 2012-03-15 9:30 AM


share|improve this question

You'd have to parse the value with XSL and XPath. Check out these links, they should get you started:

XSL if:

XPath transform():

And some related SE posts:

Hope that helps.

share|improve this answer
I can get the desired result with the following but just missing the time part, I want 9:00 AM instead of 14:00<xsl:value-of disable-output-escaping="no" select="ddwrt:FormatDateTime(string(@EventDate), 2057, 'yyyy/MM/dd HH:mm')" /> result is 12/03/2012 14:00 – 4uSharePoint Mar 15 '12 at 15:44
Try and use 1033 instead of 2057, since AM/PM probably is not used in your location (2057) it will not parse it with AM/PM. – Anders Aune Mar 15 '12 at 16:31
Try using this format string: 'yyyy/MM/dd hh:mm P' HH = hours (24 hour clock) hh = hours (12 hour clock) P = AM/PM marker Ref: (see section 16.5.1) – Wade Henderson Mar 15 '12 at 18:30
Thanks guys, the following is working, but AM/PM part is not working even I added P in the end but no luck. Can you plz let me know any alternative. select="ddwrt:FormatDateTime(string(@EventDate), 2057, 'yyyy/MM/dd HH:mm')" result is 12/03/2012 02:00 – 4uSharePoint Mar 16 '12 at 17:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.