adjusting news date output format

Posted by Community Admin on 04-Aug-2018 20:09

adjusting news date output format

All Replies

Posted by Community Admin on 30-Nov-2011 00:00

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 :)

Posted by Community Admin on 01-Dec-2011 00:00

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!

Posted by Community Admin on 01-Dec-2011 00:00

Ah! Thanks so much Tim, really appreciate the help!

This thread is closed