Why does this input field contain data- * attributes added to it?
Because you have enabled unobtrusive verification in your application. By default, the MVC verification system allows you to check on the client side both the required and the data type for value types (integer, datetime).
Why does he even think it's a date?
When you pass a string to the helper method Html.TextBox , it checks to see if Model contains any property with that name, and in your case, Model has a property called EndTime and is of type DateTime .
You pass an EndTime.Date , which still represents the DateTime type ( DateTime has a Date property that is of the DateTime type, contains only the date component), and therefore two checks are allowed by MVC.
I would suggest you create two different properties for storing date and time.
source share