I'm trying to storage into my database ONLY the DATE not DATE AND TIME, only Date, but it always came with the time together.
This is how I do to storage only the date inside of String :
string.Format("{0:dd/MM/yyyy}", DateTime.Now)
And works fine, but now, I want to storage a StringDate to a Date in my SQL Server database. So I did this :
EntityTable...
[Column(TypeName = "date")]
public DateTime? InicialDate { get; set; }
Controller
InicialDate = DateTime.ParseExact("01-12-2016",
"dd/MM/yyyy",
new CultureInfo("pt-BR"));
And inside of my Table, the Date is not at the right format as I expected, I came like this :
2017-12-01 and not, DAY-MONTH-YEAR....
And if I try to make a query and retrieve the date, i came like this :
"InicialDate": "2017-12-01T00:00:00"
I just want to save ONLY the DATE without time!