Hello,
I am using a Kendo DateTimePicker in an ASP.Net Core 2 project. The DateTimePicker shows the date properly just in a wrong (probably default) format.
The data is coming from the controller in Json format. The server side object is simple C# DateTime.
The shown date is: http://prntscr.com/kgdnwe
The wished format is for example: yyyy/MM/dd hh:mm
The code of the DateTimePicker:
@(Html.Kendo().DateTimePicker()
.Name("tbM1Added")
.Format("yyyy/MM/dd hh:mm tt")
.ParseFormats(new string[]{ "yyyy/MM/dd", "hh:mm tt" })
.HtmlAttributes(new { style = "width: 100%" })
)
The js code:
document.getElementsByName("tbM1Added")[0].value = selectedUser.M1Added;
When I write it on the console it shows:
Fri Oct 20 2017 23:11:50 GMT+0200 (Central European Summer Time)
Can you give me any idea how to achieve the desired datetime format?