Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
    
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
add comment

1 Answer

up vote 3 down vote accepted

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

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

Your Answer

 
discard

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.