Add Date property to the DateTime variable
var dateTime = DateTime.Nowvar onlyDate = dateTime.DateOr You can use DataType annotation as well.
[DataType(DataType.Date)]public DateTime dateTime {get; set;}The DataType annotation is inside the System.ComponentModel.DataAnnotations namespace.