Haven't used this for a while, I think you can do:
var dateTimeString = item.GetProperty("propertyAlias").Value.ToString(); //is Value already a String? not sure
var dateTime = XmlConvert.ToDateTime(dateTimeString);
var formattedDateTimeString = dateTime.ToString("dd.MM.yyyy");
@formattedDateTimeString
date time picker
Hello
In my Umbraco 6.1.6 page I have a field which is a date picker. I am referencing it in the code behind file as follows:
How do I format this? At the moment the output is 2016.11.07T00:00:00 I would like it to be 11.07.2016
Thank you Natasha
Haven't used this for a while, I think you can do:
Thanks so much Daniel
With one minor change (in case anyone else needs it)
is working on a reply...