Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am having a hard time just displaying the short month (JAN, FEB etc) for a date.
I currently have:
<div class="date">@Umbraco.Field("newsPublishDate", formatAsDate: true)</div>
but can't find a way to display another format...any ideas where to look?
Thanks
Hi Brain,
You can use a normal C# ToString formatting like this:
<div class="date">@(Model.Content.GetPropertyValue<DateTime>("newsPublishDate").ToString("MMMM dd, yyyy"))</div>
More info on options for formatting are available here
Hope that helps you,
Jeavon
I just added a couple of missing parentheses above that are required due to the <DateTime>
<DateTime>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Formatting Date
I am having a hard time just displaying the short month (JAN, FEB etc) for a date.
I currently have:
<div class="date">@Umbraco.Field("newsPublishDate", formatAsDate: true)</div>
but can't find a way to display another format...any ideas where to look?
Thanks
Hi Brain,
You can use a normal C# ToString formatting like this:
More info on options for formatting are available here
Hope that helps you,
Jeavon
I just added a couple of missing parentheses above that are required due to the
<DateTime>
is working on a reply...