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
Is there a way to change the time format from:
9/13/2017 2:30:00 PM
9/13/2017 14:30 PM ??
Maybe this might work for you:
string formatted = dt_calc.ToString("HH:mm:ss");
and if you using some custom data you should definitely look up Microsoft documentation on custom Datetime.
You could do the following:
When retrieving the date from your cms:
var date = Model.GetPropertyValue<DateTime>("dateInputGoesHere");
(this may be some different syntax depending on the type of razor you are using) but you mainly need to render the item as a DateTime to be aloud to use the .ToString below.
<p>@date.ToString("d MMM yy")</p>
You can read up on date formatting here: https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.80).aspx
If you show me some code samples you are working with I can try to resolve them for you.
ended up doing it like you showed!
var date = Model.Content.GetPropertyValue<DateTime>("pageDate");
if (date != DateTime.MinValue)
In Umbraco 8 you can get the formatting from https://momentjs.com/
Then use something like;
@(Model.Value<DateTime>("yourDateTimeProperty").ToString("dd MM yyyy"))
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted