1

I have created a date & time type of column in my custom list, I have selected date only as display format. I can just fill date in this field on new item form but when i see this field in display item form, i see some extra charaters with the date selected, I just want to display date on display form as well. Please help. Thanks a lot.

  • What kind of extra characters do you see? Can you add a screenshot? – Dribbel Jun 15 '12 at 12:20
  • "2012-06-01T05:00:00Z" I get this value when i select 1/June/2012. I only get this value on the display form that I've customized, not on the display form created by SharePoint. – NotesArt Jun 15 '12 at 13:13
  • That is the ISO format and can be changed. What method did you use to add this to the display form? IE what code are you using? – spevilgenius Jun 15 '12 at 13:22
3

Use something like:

<xsl:value-of select="ddwrt:FormatDate(@ArticleStartDate, 1033, 3)"/>  

Change 1033 to you LocalID and the second number is a format specifier. See here for possible values.

Make sure you have the ddwrt namespace reference xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" in the top of your xsl.

See also: this SO-question and this blog

  • i used this,worked well <xsl:value-of select="ddwrt:FormatDate(@ArticleStartDate, 1033, 1)"/> – NotesArt Jun 16 '12 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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