Design and CSS styles
Version 7.x > Design and CSS styles > change the date format in a transformation View modes: 
User avatar
Member
Member
admin-pclennox - 10/23/2013 3:34:54 PM
   
change the date format in a transformation
Hello. I'm VERY new to Kentico. I'm using a NewsRepeater on a blog and it displays the date in this format at the top as for example 10/23/2013 but I want it to display as October 23, 2013.

The transformation I'm using is:
<div class="newsItem">
<%#IfEmpty(Eval("NewsTeaser"), "", "<div class='teaser'><img src='" + GetFileUrl("NewsTeaser") + "?maxsidesize=66' alt='" + Eval("NewsTitle", true) + " ' /></div>")%>
<h3><a href="<%# GetDocumentUrl() %>"><%# Eval("NewsTitle",true) %></a> | <%# GetDateTime("NewsReleaseDate", "d") %></h3>
<p><%# Eval("NewsSummary") %></p>
<div class="clear"> </div>
</div>

I know it has something to do with <%# GetDateTime("NewsReleaseDate", "d") %> but I'm not sure what to change it too.

When i changed it to this <%# GetDateTime("NewsReleaseDate", "MM/dd/yyyy HH:mm") %>, nothing changed at all.

Thanks for the help!

User avatar
Member
Member
admin-pclennox - 10/23/2013 11:38:19 PM
   
RE:change the date format in a transformation
So after a good chunky of research, I found the answer here:

http://wiki.evident.nl/Default.aspx?Page=String%20Format%20for%20DateTime&AspxAutoDetectCookieSupport=1

So for anyone else who might have this newbie question, the short answer is that the "d" can be changed to those formats listed above.