1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / adjusting news date output format

adjusting news date output format

3 posts, 1 answered
  1. Philippe
    Philippe avatar
    3 posts
    Registered:
    30 Nov 2011
    30 Nov 2011
    Link to this post
    Im trying to adjust the output of the date of a news item to display as MM/DD/YYYY but can't seem to get it to work properly.

    I changed the code in the template to

    <sf:FieldListView ID="PublicationDate" runat="server" Format="{PublicationDate.ToLocal():mm'\/'dd'\/'yyyy}" />

    which shows up as 00/11/2011. So for some reason the mm always displays as 00 regardless of what the month is. Help please :)
  2. Tim
    Tim avatar
    258 posts
    Registered:
    22 Jun 2011
    01 Dec 2011
    Link to this post
    Philippe,

    Try this one on for size:

    <sf:FieldListView ID="PublicationDate" runat="server" Format="{PublicationDate.ToLocal():MM/dd/yyyy}" />

    Notice the capitalization on the "MM". "mm" stands for the minute, 00-59.

    Hope that helps!
    Answered
  3. Philippe
    Philippe avatar
    3 posts
    Registered:
    30 Nov 2011
    01 Dec 2011
    Link to this post
    Ah! Thanks so much Tim, really appreciate the help!
3 posts, 1 answered